![]() |
|
Main »
Batch Files
Recursive batch file to copy all files with a common extension from ALL subfolders in a directory tree to a network driveThe key to this command is the combination of the FOR command and the /R switch to recurse through all folders to execute the copy command. This single line batch file was invaluable for picking out selected files from an extensive tree structure and backing them up to a single location.
Initial code for command line, modified to a batch file and my specific application, came from the Daily Cup of Tech
or the command line stated generically: FOR %variable IN (set) DO command [command-parameters]
The difference between using this command in a batch file vs on the command line is the double "%%" in front of the variable names. Command line version requires only 1 "%"
|
Notes Investments Research Teaching ReadingList ClassicQuotes Computer Applications
PmWikiUserInfo Skin Admin Basic Editing Documentation Index pmwiki.org ![]() |
| Page last modified on July 26, 2007, at 10:09 AM - Powered by PmWiki |