0

I would like to get PSEXEC to run a .vbs file on a remote machine for me, however I currently have to have the .vbs located on the remote machine.

Below is an example of my script which does work.

psexec \\<\i.pAddress\> -u <\User\> -p <\Password\> -w c:\ -h cscript.exe "C:\Users\admin\Desktop\test.vbs"

Is there any solution which saves me having to place the test.vbs file on the remote machine before hand?

analyticalpicasso
  • 1,993
  • 8
  • 26
  • 45
Shane_S
  • 119
  • 2
  • 2
  • 9

1 Answers1

1

Use the -c option (http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx)

-c Copy the specified program to the remote system for execution. If you omit this option the application must be in the system path on the remote system.

just1lucky
  • 56
  • 3