Saved Bookmarks
| 1. |
Solve : Capture the file name as a parameter? |
|
Answer» Thanks :: This line turns echo off, which means only the output of commands is displayed. FOR STATEMENT DESCRIPTION: For /f "usebackq delims=" means that for will use backwards quotes, just a habit ` instead of '. The delims part means that the output should be treated a a whole phrase and not split into sections when a character is reached, not really necessary either. "%%I" defines a temporary variable to use in the for statement body. "in (`dir/b c:\a\*.txt`) do" For each line that the command "dir/b c:\*.txt" returns the following will be performed. "(" indicates start of body. "set name=%%~nI" Sets the variable %name% with the file name only (~N) in the variable %%I, ie no extension. ")" END body NOTE: You didn't mention the file was in a folder called "a". |
|