Results 1 to 5 of 5

Thread: Execute a BAT File in a remote machine

  1. #1
    Juanjillo Guest

    Execute a BAT File in a remote machine

    Hi,

    I have a bat file in server2.
    Im on server1 and i want to execute remotly this bat file pp.bat

    I execute a vbs file with this code:

    strComputer = "pc_name"
    Set objWMIService = GetObject ("winmgmts:\\" & strComputer &
    "\root\cimv2")
    errReturn = objWMIService.Create ("c:\pp.bat", Null, Null,
    intProcessID)


    Thank you.

    --
    Agures



  2. #2
    Jeffery Hicks Guest

    Re: Execute a BAT File in a remote machine

    On Mon, 19 Feb 2007 18:50:38 +0100, Juanjillo wrote:

    > Hi,
    >
    > I have a bat file in server2.
    > Im on server1 and i want to execute remotly this bat file pp.bat
    >
    > I execute a vbs file with this code:
    >
    > strComputer = "pc_name"
    > Set objWMIService = GetObject ("winmgmts:\\" & strComputer &
    > "\root\cimv2")
    > errReturn = objWMIService.Create ("c:\pp.bat", Null, Null,
    > intProcessID)
    >
    >
    > Thank you.


    Honestly, the fastest and easiest way to do that is to use PSEXEC and it's
    free.

    --
    Jeffery Hicks
    SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
    VBScript & Windows PowerShell Training -
    www.ScriptingTraining.com/classes.asp
    Windows PowerShell? - www.SAPIENPress.com/powershell.asp

    blog: http://blog.SAPIEN.com
    blog: http://jdhitsolutions.blogspot.com

  3. #3
    Juanjillo Guest

    Re: Execute a BAT File in a remote machine

    Thank You very much.
    I try this.

    Best reggards.

    > On Mon, 19 Feb 2007 18:50:38 +0100, Juanjillo wrote:
    >
    >> Hi,
    >>
    >> I have a bat file in server2.
    >> Im on server1 and i want to execute remotly this bat file pp.bat
    >>
    >> I execute a vbs file with this code:
    >>
    >> strComputer = "pc_name"
    >> Set objWMIService = GetObject ("winmgmts:\\" & strComputer &
    >> "\root\cimv2")
    >> errReturn = objWMIService.Create ("c:\pp.bat", Null, Null,
    >> intProcessID)
    >>
    >>
    >> Thank you.

    >
    > Honestly, the fastest and easiest way to do that is to use PSEXEC and it's
    > free.


    --
    Agures



  4. #4
    Jack Doyle Guest

    Re: Execute a BAT File in a remote machine

    Another good tool for this is BeyondExec (http://www.beyondlogic.org/
    solutions/remoteprocess/BeyondExec.htm).

    Jack Doyle, Systems Engineer
    ScriptLogic Corporation
    http://www.scriptlogic.com


  5. #5
    Juanjillo Guest

    Re: Execute a BAT File in a remote machine

    > Another good tool for this is BeyondExec (http://www.beyondlogic.org/
    > solutions/remoteprocess/BeyondExec.htm).
    >
    > Jack Doyle, Systems Engineer
    > ScriptLogic Corporation
    > http://www.scriptlogic.com


    Thank You very much.

    --
    Agures



Similar Threads

  1. Running a batch file from a remote machine in a VB code
    By Radhu in forum Software Development
    Replies: 1
    Last Post: 14-10-2011, 04:54 PM
  2. Execute a batch file on a remote computer?
    By Chris D in forum Windows Server Help
    Replies: 6
    Last Post: 20-01-2011, 10:09 PM
  3. Running an MSI file on a remote machine
    By brock_griffin@hotmail.com in forum Windows Server Help
    Replies: 6
    Last Post: 09-07-2010, 04:36 AM
  4. Replies: 1
    Last Post: 03-10-2009, 04:25 PM
  5. Execute a batch file on remote host
    By Hulicat in forum Windows Server Help
    Replies: 5
    Last Post: 20-06-2009, 01:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •