PsExec Batch Shortcut

This batch file simply saves the trouble of worrying about getting all the context right for psexec and makes it easier to run things on multiple computers with varying usernames. Help is built into the file as you can see below, so just run the batch without any paramiters for a listing.

runremote.bat

@echo off
color 1f

if "%1" == "" goto help

:runit
psexec @serverlist.txt -c -s -f -n 10 -u %1 %2
goto end

:help
echo ---
echo blog@integrii.net
echo PsExec Batch File Shortcut
echo http://blog.integrii.net
echo ---
echo PURPOSE:
echo Runs a file or command on a list of remote computers with a specified username.
echo ---
echo USEAGE:
echo runstuff [remote username] [command or file]
echo ---
echo NOTE:
echo You MUST CHANGE the serverlist.txt to contain a list of target computers. One computer per line, hostname or IP address.
echo ---
pause

:end



 View more about PsExec here:
http://www.microsoft.com/technet/sysinternals/Security/PsExec.mspxÂ