Execute a BAT File in a remote machine

Discussion in 'Scripting' started by Juanjillo, Feb 19, 2007.

  1. Juanjillo

    Juanjillo Guest


    I have a bat file in server2.
    I´m 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 &
    errReturn = objWMIService.Create ("c:\pp.bat", Null, Null,

    Thank you.
    Juanjillo, Feb 19, 2007
    1. Advertisements

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

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

    blog: http://blog.SAPIEN.com
    blog: http://jdhitsolutions.blogspot.com
    Jeffery Hicks, Feb 20, 2007
    1. Advertisements

  3. Juanjillo

    Juanjillo Guest

    Thank You very much.
    I try this.

    Best reggards.
    Juanjillo, Feb 20, 2007
  4. Juanjillo

    Juanjillo Guest

    Juanjillo, Feb 23, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.