Announcement

Collapse
No announcement yet.

cmd...how to short time for searching for remote machine...

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • cmd...how to short time for searching for remote machine...

    hello...
    I want to run computer mangement.msc console from computers on lan via bat script.

    mmc.exe c:\windows\system32\compmgmt.msc /computer:name1
    mmc.exe c:\windows\system32\compmgmt.msc /computer:name2
    mmc.exe c:\windows\system32\compmgmt.msc /computer:name3

    Everything work find but when script try to open computer which is off script wait and wait to run next line. How I can run script with limited time to execute every line (maybe 2-3 sec.)?

    thanks

  • #2
    Re: cmd...how to short time for searching for remote machine...

    Before connecting to the remote computer, try to ping it to see if the computer is connectable:

    Code:
    @echo off
    title connect to management console on remote computers
    color 9E
     
    call:compmgmt name1
    call:compmgmt name2
    call:compmgmt name3
    call:compmgmt name4
     
    echo.&echo.finished!
    pause>nul
     
    Goto:EOF ----------------
     :compmgmt  subroutine
     Set "strComputer=%*"
     Ping.exe -n 2 -w 350 %strComputer% | Find/i "TTL=" >Nul &&(
     start ""/w mmc.exe "%windir%\system32\compmgmt.msc" /computer:%strComputer%)||(
     echo.%strComputer% was not pingable)
    Goto:EOF ----------------
    \Rems

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment

    Working...
    X