#37035 - 2003-02-27 09:34 AM
Fast check if the workstation (PC) is turned on
|
Luziekix
Getting the hang of it
Registered: 2003-02-27
Posts: 68
|
Hi!
With the following Script-Line I would like to disable the Internet-Connections on school-PC from the Teacher-PC:
$Err=WriteValue("\\BBS-GER701\HKEY_USERS\S-1-5-21-57989841-1202660629-1060284298-2727\Software\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyEnable","0","REG_DWORD")
.... for each Student-PC with different PC-name and different USER-SID. This works OK an fast, if all PCs are turned on. But if some of the PCs are turned off it takes about 30 Seconds for my scripts to go on to the next PC to make the setting.
Can someone help me out and have an idea on how to FAST check if the stundent-PC is turned on, so I could only try to do this settings then.
Regards,
Luziekix
|
|
Top
|
|
|
|
#37038 - 2003-02-27 09:45 AM
Re: Fast check if the workstation (PC) is turned on
|
onlinrgames
Fresh Scripter
Registered: 2002-07-23
Posts: 27
|
Hi Luziekix,
Here's what we do to check the machine status before applying any KiXtart scripts.
- Do a PING test of the machine and log the result to a text file. - If the machine returns "Request timed out" message, consider the machine as OFF and move onto the next one.
A sample code would be :
code:
Break On Shell "cmd.exe /c ping m/c_name -n 1 > result.txt" If Open(3,"result.txt",2) = 0 $Readline_val = ReadLine(3) While @error = 0 If $Readline_val = "Request timed out." ? "Machine not On. Skip to next m/c" Del ("Result.txt") EndIf $Readline_val = ReadLine(3) Loop $ = Close(3) Del ("Result.txt") EndIf
Regards
Onlinegames
|
|
Top
|
|
|
|
#37040 - 2003-02-27 11:02 AM
Re: Fast check if the workstation (PC) is turned on
|
Luziekix
Getting the hang of it
Registered: 2003-02-27
Posts: 68
|
Well thank you all for your fast help !!!
I now use this: (Sample in german, if someone need it in english, please request it from me!)
Break On $PCON=1 Shell "cmd.exe /c ping BBS-GER701 -n 1 > C:\TEMP\result.txt" If Open(3,"C:\TEMP\result.txt",2) = 0 $Readline_val = ReadLine(3) While @error = 0 If $Readline_val = "Zeitberschreitung der Anforderung." $PCON=0 Del ("C:\TEMP\Result.txt") EndIf $Readline_val = ReadLine(3) Loop $ = Close(3) Del ("C:\TEMP\Result.txt") If $PCON=0 AT (1,0) "BBS-GER701: PC ist ausgeschaltet oder nicht am Netz!" ELSE $Err=WriteValue("\\BBS-GER701\HKEY_USERS\S-1-5-21-57989841-1202660629-1060284298-2727\Software\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyEnable","1","REG_DWORD") If $Err=0 AT (1,0) "BBS-GER701: Internet EIN-geschaltet. IE dort schliessen / neu öffnen!" ELSE AT (1,0) "BBS-GER701: FEHLER: User nicht eingeloggt ?!" ENDIF Endif EndIf
Regards;
Luzie
|
|
Top
|
|
|
|
#37042 - 2003-02-27 11:27 AM
Re: Fast check if the workstation (PC) is turned on
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
|
Top
|
|
|
|
#37045 - 2003-02-27 03:50 PM
Re: Fast check if the workstation (PC) is turned on
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 756 anonymous users online.
|
|
|