Wells
Wells

Reputation: 103

Using psexec to run a batch file containing a VBScript on remote machine (completes with no errors but nothing happens)

I've confirmed that I can successfully run a batch file on my remote machine. However, when I try to run a vbs file remotely it says it starts on the remote server and gives it a process ID, but nothing happens. To test, I made a batch file on the remote server that runs the vbs script (same folder) and it runs successfully. When I then try to run this batch file remotely I have the same issue as when I tried to run the vbs file directly.

psexec -i 2 -d \\server cscript filepath\file.vbs

My test VBScript is just a msgbox. When I run it remotely a black box opens up and the buttons/text are not visible.

Any ideas?

Upvotes: 0

Views: 738

Answers (1)

Sam H
Sam H

Reputation: 362

I believe you need to set the working directory to get the interaction to work properly.

For example try:

psexec -i 2 -w C:\Temp -d \\server cscript filepath\file.vbs

More information about PSExec switches can be found here: https://learn.microsoft.com/en-gb/sysinternals/downloads/psexec

Upvotes: 1

Related Questions