2

Is it possible to place a shortcut on a client which will run a bat (or vbscript) file on a server? (as opposed to the script running on the client)

It seems pretty basic, but I'm at a loss how this would be done.

David
  • 439
  • 1
  • 5
  • 17

1 Answers1

3

There is an excellent suite of tools called PsTools which includes PsExec. PsExec allows you to remotely execute programs on another machine (or in this case a server). You have to have the appropriate authority/credentials to do so of course.

The following psexec command would run the batch file my_batch_file.bat located in directory "C:\batch" (on the server) as user 'johndoe' with account password 'Asdf1234' on server with name 'ServerName':

psexec \\ServerName -u johndoe -p Asdf1234 c:\batch\my_batch_file.bat

Note that the batch file would have to exist on the server already in this example.

Read more about PsExec here: http://technet.microsoft.com/en-us/sysinternals/bb897553

JJ.
  • 203
  • 2
  • 10
  • Thanks, looks like a great option. Since I posted I started going to iis route to run the file, since iis happens to be running on the server already. If that causes me any trouble I'll use psexec. – David Jun 04 '12 at 18:14