Is it possible to execute a batch file on a remote PC or server?
Is it possible to execute a batch file on a remote PC or server?
Using psexec.exe, you can execute any non-GUI program on a
remote machine. You can get it from
I would like to know if there is a command to use. I use PSExec all the time but I'm working on making a VB program and need a code for that.
It is nicest if you do not have to use a 3rd party software.
This will probably do the trick:
http://www.microsoft.com/technet/scr...5/hey0701.mspx.
For more details I recommend you post scripting questions in a scripting
newsgroup, e.g. in server.scripting.
Hi
Did you get any vb code regarding the same ?
Please post the batch file
You can try to add the computer names to a text file named computerlist.txt, one per line. Then paste the script below into a different text file with a .cmd extension.
Code:@echo off setlocal set startdir=c$\Documents and Settings\All Users\Start Menu\Programs\Startup set newfile=\\w2k3fs01\login\winsocktest\winsocktest1.exe.lnk for /F %%G in (computerlist.txt) do ( del /q "\\%%G\%startdir%\Shortcut to winsocktest1.*" 2>> errors.txt xcopy "%newfile%" "\\%%G\%startdir%\" /C /H /R /Y 2>> errors.txt )
Bookmarks