Results 1 to 7 of 7

Thread: Execute a batch file on a remote computer?

  1. #1
    Chris D Guest

    Execute a batch file on a remote computer?

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

  2. #2
    Pegasus \(MVP\) Guest
    Using psexec.exe, you can execute any non-GUI program on a
    remote machine. You can get it from

  3. #3
    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.

  4. #4
    Pegasus [MVP] Guest

    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.

  5. #5
    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 ?

  6. #6
    Join Date
    Jan 2011
    Posts
    1

    Re: Execute a batch file on a remote computer?

    Please post the batch file

  7. #7
    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 
    )

Similar Threads

  1. How to execute commands of batch file at timed intervals
    By Camryn in forum Software Development
    Replies: 5
    Last Post: 27-03-2010, 08:47 PM
  2. How to execute a command in a remote computer?
    By austin26 in forum Technology & Internet
    Replies: 3
    Last Post: 12-12-2009, 08:34 PM
  3. Replies: 1
    Last Post: 03-10-2009, 04:25 PM
  4. Execute a batch file on remote host
    By Hulicat in forum Windows Server Help
    Replies: 5
    Last Post: 20-06-2009, 01:35 AM
  5. Execute a BAT File in a remote machine
    By Juanjillo in forum Windows Server Help
    Replies: 4
    Last Post: 23-02-2007, 01:55 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,702,135,233.96672 seconds with 17 queries