Jump to content

psexec and folders with spaces


Recommended Posts

Good Morning,

I want to take this:

Run("cmd.exe")
Sleep(1000)
Send("cd /{Enter}")
Sleep(1000)
Send("cd pstools{Enter}")
Sleep(1000)
Send("psexec \\192.168.26.17\ cmd.exe{Enter}")
Sleep(5000)
Send("cd /{Enter}")
Sleep(2000)
Send("cd Program Files\WebHelpDesk{Enter}")
Sleep(2000)
Send("whd_stop.bat{Enter}")

and make it into something like this

Run("c:\psexec \\192.168.26.17 -s c:\program files\webhelpdesk\whd_stop.bat")

However when I run the second one, I get an error that states that PSEXEC is already running on the remote PC. It would appear that it is trying to run the script however something in the translatation is causing PSEXEC on the remote PC to hang. Any ideas on what is wrong with the script? I goal here is to execute the remote batch file but have the cmd window open and showing the results on my local PC.

Thanks,

Grimm

Edited by grimmlock

Thanks

Grimm

Link to comment
Share on other sites

Does this work?

Run('c:\psexec \\192.168.26.17 -s "c:\program files\webhelpdesk\whd_stop.bat"')

edit: Removed URL tags when copied and pasted

edit: I am assuming that path and file exists on the destination machine?

Edited by spudw2k
Link to comment
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
 Share

×
×
  • Create New...