Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Execute a batch file on a remote computer?

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 14-03-2007
Chris D
 
Posts: n/a
Execute a batch file on a remote computer?

Is it possible to execute a batch file on a remote PC or server?

Reply With Quote
  #2  
Old 14-03-2007
Pegasus \(MVP\)
 
Posts: n/a
Using psexec.exe, you can execute any non-GUI program on a
remote machine. You can get it from
Reply With Quote
  #3  
Old 18-06-2009
Member
 
Join Date: Jun 2009
Posts: 3
re: Execute a batch file on a remote computer?

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.
Reply With Quote
  #4  
Old 18-06-2009
Pegasus [MVP]
 
Posts: n/a
re: Execute a batch file on a remote computer?

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.
Reply With Quote
  #5  
Old 26-02-2010
Member
 
Join Date: Feb 2010
Posts: 1
Re: Execute a batch file on a remote computer?

Hi

Did you get any vb code regarding the same ?
Reply With Quote
  #6  
Old 20-01-2011
Member
 
Join Date: Jan 2011
Posts: 1
Re: Execute a batch file on a remote computer?

Please post the batch file
Reply With Quote
  #7  
Old 20-01-2011
Member
 
Join Date: Jan 2006
Posts: 605
Re: Execute a batch file on a remote computer?

Quote:
Originally Posted by hardpfr View Post
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 
)
Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Execute a batch file on a remote computer?"
Thread Thread Starter Forum Replies Last Post
How to execute commands of batch file at timed intervals Camryn Software Development 5 27-03-2010 08:47 PM
How to execute a command in a remote computer? austin26 Technology & Internet 3 12-12-2009 08:34 PM
need to execute 2 KB article security patch file to the remote computers srikesavan9 Windows Software 1 03-10-2009 04:25 PM
Execute a batch file on remote host Hulicat Windows Server Help 5 20-06-2009 01:35 AM
Execute a BAT File in a remote machine Juanjillo Windows Server Help 4 23-02-2007 01:55 PM


All times are GMT +5.5. The time now is 12:39 AM.