| 1. |
Solve : Extract File Name from Folder? |
|
Answer» Please Help! I am trying to find a way to extract a file name from a DIRECTORY of files. For example, if you have a FOLDER named "C:\scanadm\file\in" that contains files FOR /R C:\scanadm\file\in %A IN (*.*) DO (Get Individual Name of File and Put in Variable) Not sure what the PROBLEM is. You have a variable (%A) which will contain the FULLY qualified file name. If you don't want the path info, you can use: Code: [Select]FOR /R C:\scanadm\file\in %A IN (*.*) DO (ECHO %~nxA) Don't recommend using %~nxA; the /R switch walks the directory structure (recursion) and you may want to keep file names unique. |
|