Results 1 to 12 of 12

Thread: [RESOLVED] Escape Double Quotes Around Path in Shell Command

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Vladamir's Avatar
    Join Date
    Feb 2012
    Location
    Miami, FL
    Posts
    486

    Resolved [RESOLVED] Escape Double Quotes Around Path in Shell Command

    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.

    Code:
    Sub Main()
       Shell("cmd /c forfiles /P "S:\Customer Approval" /M *.dwg /D -7 > C:\TEMP\OldFiles.txt")
    End Sub
    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.
    Last edited by Vladamir; Sep 7th, 2012 at 09:14 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width