#36657 - 2003-02-19 03:21 PM
Disabling Internet by room number
|
Billy
Fresh Scripter
Registered: 2002-11-06
Posts: 34
Loc: Birmingham, England
|
I work at a school where we currently enable and disable the internet by year group, this is done by using the script below:
;disable proxy If InGroup("YR8") $rmv = DelKey("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings") Shell "regedit /s c:\WINDOWS\disanet.reg" EndIf
Is there any way of changing the script to enable and disable the internet in room rather than year group. The computers are named by which room they are in. For example, the fourth computer in the room called S5 is call S5-04. Would be extremely grateful if any one can help.
THANX
|
|
Top
|
|
|
|
#36661 - 2003-03-14 12:20 AM
Re: Disabling Internet by room number
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Is there anyway of using the @worksta macro to determine what room the machine is in?
Maybe if I use something like SET Room=S5 for all machines that are in S5. Then kix checks this is true in the config.sys file reads this if the condition is true then runs a script to disable the proxysever...
Is this possible
Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
|
Top
|
|
|
|
#36662 - 2003-03-13 01:04 PM
Re: Disabling Internet by room number
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Perhaps a READPROFILESTRING command something like; code:
$rd = ReadProfileString("c:\autoexec.bat", "", "ROOM") If $rd="ITOFF" ? "read this string result is " + $rd Endif
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
|
Top
|
|
|
|
#36664 - 2003-03-13 01:40 PM
Re: Disabling Internet by room number
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
|
Top
|
|
|
|
#36665 - 2003-03-13 01:56 PM
Re: Disabling Internet by room number
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
JPOLS,
THANKS FOR YOUR COMMENTS, THOUGH BILLY IS MY TECHNICIAN.
ReadProfileString will work in INI format is this possible for one of these to include ROOM=S5 ETC this way I an use kix to detemine the room the computers are in...
Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
|
Top
|
|
|
|
#36666 - 2003-03-13 02:13 PM
Re: Disabling Internet by room number
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Have got a solution used win.ini...
Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
|
Top
|
|
|
|
#36667 - 2003-03-13 02:17 PM
Re: Disabling Internet by room number
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
ah ok ... can't smell that
Billy stated :
quote: The computers are named by which room they are in. For example, the fourth computer in the room called S5 is call S5-04
so the possible scriptlet (using at least KiX 4.20) would be :
ini-file used to determine which are enabled :
code:
[RoomsEnabled]
Rooms=S5,S4,S3
Script to run :
break on
$ini = "[path]\inifile.ini"
$enabled = split(readprofilestring($ini, "RoomsEnabled" , "Rooms"), ",")
if ascan($enabled, substr(@wksta,1,2) ) > -1 ; first 2 chars of Workstationname ; matches one of the elements of $enabled ; do the appropriate step to enable here! else ; disable! $rmv = delkey("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings") Shell "regedit /s c:\WINDOWS\disanet.reg" endif
hth [ 13. March 2003, 14:19: Message edited by: jpols ]
_________________________
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 837 anonymous users online.
|
|
|