Reputation: 997
Right now if I run a VBScript from a VBScript like this:
CreateObject("Wscript.Shell").Run("""runscript.vbs""")
This opens up runscript.vbs
, which works!
If a create a subfolder to put the VBScript and reference it like below:
CreateObject("Wscript.Shell").Run("""x64/runscript.vbs""")
No error, but the script doesn't open like it should.
I know absolute path would work, but for the purpose of the script I can't use absolute path.
Upvotes: 1
Views: 889
Reputation: 16311
Either of the following should work.
Use a backslash instead of a forward slash:
CreateObject("WScript.Shell").Run "x64\runscript.vbs"
Use the CurrentDirectory
property to set the working folder:
With CreateObject("WScript.Shell")
.CurrentDirectory = "x64"
.Run "runscript.vbs"
End With
Upvotes: 3