-1
Set oShell = WScript.CreateObject("WSCript.shell")
oShell.run "cmd /K cd \ & cd C:\Users\me & cscript /nologo Setup.vbs > newfile & del example.ini & ren newfile example.ini & move example.ini C:\Program Files (x86)\Setup Folder"

Above is my code in which I'm trying to run a script and replace a file in the destination directory. My other script works fine and isn't causing any issues, but in this script I cannot seem to move the file to the destination (C:\Program Files (x86)\Setup Folder) because of the spaces in the directories.

I have tried using /, "'s (this one will not work I realize as it will read the script and believe it to be the end of it), and single quotes ('), before each space of the directory but none of them work.

How would one be able to move a file from one place to the other while still in the script if the directories have spaces in them?

halfer
  • 19,824
  • 17
  • 99
  • 186
Chris
  • 1

1 Answers1

0

I found the answer to my own question through a bit more research.

The reason it was not working is because I didn't add a set of double quotes before my destination directory. By doing

""C:\Program Files (x86)\Setup Folder"

It worked. I'll leave this here for anybody who encounters this issue in the future.

Chris
  • 1