Sign in to follow this  
Followers 0
botanic

run not working with @ScriptDir

2 posts in this topic

#1 ·  Posted (edited)

I have the following code

$PID = Run(@ComSpec & " /k " & @ScriptDir & "\" & $ConsoleCLI & ">" & $logfile, "")

The @ScriptDir is "C:Program Files (x86)test"

however when it tries to run i get the following error

 

'C:Program' is not recognized as an internal or external command,
operable program or batch file.
 

 

If anyone can help with why this isnt working, thanks a ton!

I printed the whole string and it comes out to

 

C:Windowssystem32cmd.exe /k C:Program Files (x86)testtest.exe >C:ProgramDatatestout.log

Edited by botanic

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Got it the following code worked! Had to put " " on the path

@ComSpec & " /k " & """" & @ScriptDir & "\" & $rsyncpath & """" & $ConsoleCLI & ">" & $logfile
Edited by botanic

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0