Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

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

share|improve this answer
    
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 4 '12 at 18:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.