Hi I can not figure out how to move a bunch of folders to a BACKUP folder.
I have a bunch of folders named something like
070119_12.13-14.12
070114_13.13-15.23
070113_15.13-22.54
070112_14.13-23.33
BACKUP
SHORTCUT.lnk
I whant to move all the 0701...... folders to the BACKUP folder. Just keeping the BACKUP and shortcut in the root.
I have a hard time getting wildcard (*) to work with directory handling.
Thanks!
Moving folders with wildcard
Moderators: JRL, Dorian (MJT support)
-
- Pro Scripter
- Posts: 149
- Joined: Tue Mar 23, 2004 9:11 pm
I always use DOS for file handling. try something like this:
Let>RP_WAIT=1
Run>cmd /c dir 0701* /ad /b > %TEMP_DIR%dirlist.txt
Let>k=0
Label>start
add>k,1
ReadLn>%TEMP_DIR%dirlist.txt,%k%,line
If>%line%=##EOF##,done
Run>cmd /c xcopy "[drive]:\path\%line%" "[drive]:\path\" /E /C /Y
Goto>start
Label>done
DeleteFile>%TEMP_DIR%dirlist.txt
Check the parameters for "xcopy" to make sure that they meet your requirements. Do this by opening a DOS window and typing xcopy /?
This script has not been tested there might be typos.
Hope this is helpful,
Dick
Let>RP_WAIT=1
Run>cmd /c dir 0701* /ad /b > %TEMP_DIR%dirlist.txt
Let>k=0
Label>start
add>k,1
ReadLn>%TEMP_DIR%dirlist.txt,%k%,line
If>%line%=##EOF##,done
Run>cmd /c xcopy "[drive]:\path\%line%" "[drive]:\path\" /E /C /Y
Goto>start
Label>done
DeleteFile>%TEMP_DIR%dirlist.txt
Check the parameters for "xcopy" to make sure that they meet your requirements. Do this by opening a DOS window and typing xcopy /?
This script has not been tested there might be typos.
Hope this is helpful,
Dick