| Wake on Lan |
| Mittwoch, den 08. Juli 2009 um 10:52 Uhr |
|
Wake on Lan, Shutdown übers LAN (wenn Rechte vorhanden) und kleine Batch um den shutdown des Servers abzubrechen, wenn man versehentlich statt PC5 den Server (192.168.1.5) herunterfährt. Die wake.exe, die ich verwende, besitzt leider keine Informationen woher sie stammt. Die Zuordnung PC Nummer-> MAC könnte besser sein, und oben in der Schleife ist die Computer Anzahl statisch (20). @echo off set broadcast=192.168.1.255 echo all=PC1 bis PC20 echo Starte PC (1..n/all): set /P comm= if "%comm%"=="all" ( for /L %%c IN (1,1,20) DO call :wake %%c ) ELSE ( call :wake %comm% ) goto :ende :wake set pcnum=%1 set mac=0 if "%pcnum%"=="1" set mac=00-00-00-00-00-00 if "%pcnum%"=="2" set mac=00-00-00-00-00-00 REM etc... echo --------- PC NR: %pcnum% -------------------------------- echo. if "%mac%"=="0" ( echo FEHLER PC Nummer %pcnum% nicht in der Liste vorhanden. ) ELSE ( echo wake %mac% %broadcast% wake %mac% %broadcast% ) echo. echo ----------------------------------------------------- echo. goto :return :ende echo ----- END ----- pause :return
@echo off set ipstart=192.168.1. echo all=101 bis 120 echo Shutdown PC (1..n/all): set /P comm= if "%comm%"=="all" ( for /L %%c IN (101,1,120) DO call :wake %%c ) ELSE ( call :wake %comm% ) goto :ende :wake set pcnum=%1 if %pcnum% LSS 100 ( echo DIESE BATCH ERLAUBT NUR IPs groesser 100 goto :return ) set pcon=0 echo --------- PC NR: %pcnum% -------------------------------- echo. ping -n 1 %ipstart%%pcnum% > nul && set pcon=1 if %pcon%==0 ( echo %ipstart%%pcnum% antwortet nicht auf PING. ) ELSE ( echo %ipstart%%pcnum% scheint an zu sein set pcon=1 echo shutdown /s /m \\%ipstart%%pcnum% shutdown /s /m \\%ipstart%%pcnum% ) echo. echo ----------------------------------------------------- echo. goto :return :ende echo ----- END ----- pause :return
shutdown -a /m \\192.168.1.X @echo off cls echo HAST DU WIEDER NICHT AUFGEPASST DU EIMER??? pause |