Then I start running the commands like this:
Set wshShell = WScript.CreateObject ("WSCript.shell")
wshshell.run "\\" & strsvr & "\foldername\foldername\foldername
\install.exe", , True
My problem is when there are spaces in the path. I know that using 3
sets of quotes solves the problem with spaces, but this does not work
when I use a variable in the middle of the entire path, like this:
wshshell.run "\\" & strsvr & """\foldername\folder name\folder name
\install.exe""", , True
Nor does assigning the path to a variable work, such as:
installPath = """\foldername\folder name\folder name\install.exe"""
wshshell.run "\\" & strsvr & installPath, , True
I have just started teaching myself vbscript, so I'm still very new to
this.
Any help would greatly appreciated
The quotes need to enclose the entire path. So, in this case, the
construct should look something like this ...
installPath = "\foldername\folder name\folder name\install.exe"
wshshell.run """\\" & strsvr & installPath & """", , True
Or use the Chr(34) construct instead ...
installPath = "\foldername\folder name\folder name\install.exe"
wshshell.run Chr(34) & "\\" & strsvr & installPath & Chr(34), , True
Tom Lavedas
-------------------
Worked like a charm!!!!
I cannot thank you enough. I've been struggling with this for days.
Glad to be of some assistance.
Tom Lavedas
-------------------