I have run into a real mind bender here. How does one escape double quotes in a shell command to use a pathname which has a space in it.
I'm wanting to make a list of the files in our Customer Approval folder which are older than 7 days. The command line syntax of this works fine in a cmd window, but I can't seem to figure out how to escape the double quotes around "S:\Customer Approval". I've tried " "S:\Customer Approval" "...etc but it doesn't seem to work right.Code:Sub Main() Shell("cmd /c forfiles /P "S:\Customer Approval" /M *.dwg /D -7 > C:\TEMP\OldFiles.txt") End Sub




Reply With Quote