• Home
  • Contact
bogge.info

The brain dump of bogge.

  • Contact
  • Blog
    • Computer
    • Food
    • Fun stuff
    • Graphic
    • msi
    • Pirate
      • Scripting
        • AutoIT
        • Crystal syntax
        • Etomite CMS
        • HTML
        • PHP
        • VBScript
    • Software
  • Photo
    • Interior
    • Landscape
    • Nature
    • Sky

Browsing Category VBScript

vbscript to run a bat against several computers

Posted on February 20, 2010 by bogge

This is a real simple vbscript to run a bat file with computer name as a parameter.
Computer names is in a string that splits in a array, then loop the array to send a command for each computer.

strMachines = "Computer1;Computer2;Computer3;Computer4;Computer5"
aMachines = split(strMachines, ";")
For Each machine in aMachines
 Set WshShell = WScript.CreateObject("WScript.Shell")
 WshShell.Run "\ServerSourceavdeploymentpush.bat " & machine
Next
Wscript.Echo("Done")

In the bat file you just add the variable %1 to capture the computer name.

  • Connect with us:
  • RSS
  • © 2013 www.bogge.com
  • Inre röster, yttre tystnad | Nollbudget | bogge.tv | FRA-Shoppen