Vbscript - having trouble constructing a run command
I am having trouble constructing a run command using a variable derived from currentDirectory. I have so far:
strDir=wshShell.CurrentDirectory
restofpath = "\SourceFiles\desktop.exe /silent"
newpath = strDir & restofpath
When I echo out newpath, I have the path to the executable and the switch perfectly.
I would like to construct a wshell.run command using the newpath variable and 8, True at the end of the statement. I have tried numerous formats and I keep getting the error 'The system cannot find the file specified.' and I think I just don't have enough experience with Vbscript formatting to find the right combination.
Any help would be appreciated.
strDir=wshShell.CurrentDirectory
restofpath = "\SourceFiles\desktop.exe /silent"
newpath = strDir & restofpath
When I echo out newpath, I have the path to the executable and the switch perfectly.
I would like to construct a wshell.run command using the newpath variable and 8, True at the end of the statement. I have tried numerous formats and I keep getting the error 'The system cannot find the file specified.' and I think I just don't have enough experience with Vbscript formatting to find the right combination.
Any help would be appreciated.
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
the.fly
19 years ago
Also, as a continuation of the same problem. I need to run a second command with using the same CurrentDirectory variable but with the additional problem of having to use a parameter for the execuatable that must contain "" around a staement. The parameter is -uncpath=C:\test\tets1\test2" -silent. I think this one will be even harder to construct a run command.
Posted by:
the.fly
19 years ago
I have figured out the first problem![8|] But the second run command is harder. Let me see if I can restate it better:
Here is an example of what works at the command prompt:
c:\test\test1\test2\SourceFiles\eau.exe -uncpath="c:\test\test1\test2\SourceFiles" -silent
I am having two issues: The first is that the path 'c:\test\test1\test2' in both parts of the run command will not be hard coded, it will be ascertained through the CurrentDirectory function.
The second issue is that the variable ascertained from CurrentDirectory also sits in between quotes.
I hope this explains it a bit better.
Here is an example of what works at the command prompt:
c:\test\test1\test2\SourceFiles\eau.exe -uncpath="c:\test\test1\test2\SourceFiles" -silent
I am having two issues: The first is that the path 'c:\test\test1\test2' in both parts of the run command will not be hard coded, it will be ascertained through the CurrentDirectory function.
The second issue is that the variable ascertained from CurrentDirectory also sits in between quotes.
I hope this explains it a bit better.
Posted by:
WiseUser
19 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.