#36003 - 2003-02-05 11:36 AM
disable keyboard in win2k
|
AmunRa
Fresh Scripter
Registered: 2003-02-05
Posts: 8
|
Is it possible to disable your keyboard in win2k? I need a script for that!!!
I give a little explaination (if that word exists lol)... We have some users on a network, and at the startup there is running a script. The script starts a batch file that looks for user who are loggedin serveral times. BUT...the smart asses have find out that when the batch is running the can use CTRL+C to interupt it... That way they can login again. So that's why i place this question !
Greetz and thx,
AmunRa
PS. Sorry for my bad English, I am from Holland !
|
Top
|
|
|
|
#36005 - 2003-02-05 11:54 AM
Re: disable keyboard in win2k
|
AmunRa
Fresh Scripter
Registered: 2003-02-05
Posts: 8
|
Well.....I have deleted the batch and pasted it into the kix script. That works but they can still use the CTRL+C combination. [ 05. February 2003, 11:56: Message edited by: AmunRa ]
|
Top
|
|
|
|
#36007 - 2003-02-06 12:01 AM
Re: disable keyboard in win2k
|
AmunRa
Fresh Scripter
Registered: 2003-02-05
Posts: 8
|
The Break thing is a problem...it does not work when I tell the script Break off. They can still CTRL+C it !
(I don't want to act like a total dork....but I am just a loser and newbie in scripting in Kix)
|
Top
|
|
|
|
#36009 - 2003-02-06 12:54 AM
Re: disable keyboard in win2k
|
AmunRa
Fresh Scripter
Registered: 2003-02-05
Posts: 8
|
Version 4.12.0.0
Maybe a to old version?
|
Top
|
|
|
|
#36011 - 2003-02-05 02:55 PM
Re: disable keyboard in win2k
|
AmunRa
Fresh Scripter
Registered: 2003-02-05
Posts: 8
|
Well it's quite a long script, but this is the part what it's all about:
BREAK OFF (-> this is on top of the script)
IF @WKSTA = "PDKCITRIX1" OR @WKSTA = "PDKCITRIX2" IF @INWIN = 1 ; WNT ;SHELL "\\pdkfp\netlogon\logout.bat" ENDIF ENDIF
and the logout.bat contains the following:
IF %COMPUTERNAME%==PDKCITRIX1 GOTO LOGOFF IF %COMPUTERNAME%==PDKCITRIX2 GOTO ENDLOGOFF GOTO ENDLOGOFF :LOGOFF For /F "Tokens=1" %%I in ('\\pdkfp\netlogon\queryuser.bat') Do Set sessions=%%I IF %sessions%==1 goto ENDLOGOFF msg %sessionname% U ben al een keer aangemeld en wordt uitgelogt, neem contact op met afdeling ICT sleep 3 logoff %SESSIONNAME% :ENDLOGOFF
Hope you can do something with it?
|
Top
|
|
|
|
#36013 - 2003-02-05 03:18 PM
Re: disable keyboard in win2k
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
In fact, here is an example...
code:
; Created with the AutoItX ActiveX component. ; Get it at: http://www.hiddensoft.com/AutoIt/
$objAutoIt = CreateObject("AutoItX.Control") If @ERROR "AutoIt Control not instantiated..." ? Copy @SCRIPTDIR+"\AutoItX.dll" %WINDIR% If @INWIN = "1" Shell "%COMSPEC% /c Regsvr32 /s %WINDIR%\AutoItX.dll" Else Shell "%COMSPEC% /c %WINDIR%\System\Regsvr32 /s %WINDIR%\AutoItX.dll" EndIf $objAutoIt = CreateObject("AutoItX.Control") If @ERROR "Unable to instantiate control: fatal error" Exit 1 EndIf endif
If $objAutoIt $objAutoIt.BlockInput("On") ; Do stuff here... $objAutoIt.BlockInput("Off") EndIf
|
Top
|
|
|
|
#36017 - 2003-02-05 03:38 PM
Re: disable keyboard in win2k
|
AmunRa
Fresh Scripter
Registered: 2003-02-05
Posts: 8
|
Ow ok guy's thx for the reply's. I'll look if i get it working...and...urhm...sealeopard...WKIX32? [ 05. February 2003, 15:39: Message edited by: AmunRa ]
|
Top
|
|
|
|
#36022 - 2003-02-05 04:07 PM
Re: disable keyboard in win2k
|
AmunRa
Fresh Scripter
Registered: 2003-02-05
Posts: 8
|
Thx m8 for all the work...and i don't want to be a giant stone on your leg...but the code does not seems to work.
It runs like a fast ferrari, but it does not log the user off sorry.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 194 anonymous users online.
|
|
|