Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wildcard for Folders
#1
I want to delete all folders that contain "archive" in the folder name
I am just evaluating this software and have searched this forum
This is what I tried.

del "c:\plans\test\*archive\"
#2
* can be used only in file names. Use Enumerate Files dialog from the floating toolbar.

Code:
Copy      Help
Dir d; str sPath
foreach(d "c:\plans\test\*archive" FE_Dir 0x1)
,sPath=d.FileName(1)
,out sPath ;;only for debugging; delete or comment this
,;del sPath ;;uncomment this
#3
Thanks for the quick reply. I'll give it a try.

Rob
#4
really give that toolbar thing a try...wow does that make it easy to do all that file function stuff.
#5
I'm back. This code works well for deleting the archive folders in c:\plans, but I need to delete the arcive folders located in the sub-folders as well. (c:\plans\bungalow\smith_archive). I suppose I could use the same code 12 times (12 sub-folders) but there is probably an easier way.

Rob
#6
Use flag 4.

Code:
Copy      Help
foreach(d "c:\plans\test\*archive" FE_Dir 1|4)
#7
Thanks! I would like to ask one last question. I use a dos batch file to backup my files. Like this.
XCOPY C:\PLANS Z:\ /S /M
echo off
REM /S BACKS UP SUBDIRECTORIES /M RESETS ARCHIVE BIT
I have searched the help file but I cannot find anything on resetting the archive bit.

Rob
#8
Here you can Search and find something useful too.

http://www.quickmacros.com/forum/showthread.php?tid=574
#9
This also should work, although not tested:

system "XCOPY C:\PLANS Z:\ /S /M"
#10
you know i'd been using synctoy for a while but it blew out on me and i have no way to get my mappings back (thanks ITS for completely USELESS backup strategy) so now i'm just going back to XCOPY and QM.



keyword:
cmd.exe
An old blog on QM coding and automation.

The Macro Hook


Forum Jump:


Users browsing this thread: 1 Guest(s)