Jump to content

New to AutoIt, lock mouse keyboard


Recommended Posts

Hello Y'all,

I am new to autoit.

I am looking for a way to lock the input from the mouse/keyboard on multiple pc's (on which AutoIt is NOT installed!) I am correct in the assumption that a AutoIt-script can do this AND that this script can be changed into a executable that can run WITHOUT Autoit?

If so, can someone point me to a sample script that can do this? If so, how do i change the script into a executable?

(i did a preliminairy search in this forum but i am not sure)

Thanks for your reply!

Link to comment
Share on other sites

well, i'm also new to autoit, but you can compile the script to an .exe but just right clicking on the .au3 script and selecting "convert to .exe", but as far as making the user interface void, im not sure, and sort of interesed myself as to how to do this. you can also compile scripts from the start menu. start>autoit>compile script. you can add your own custom .ico to this as well. have fun.!!

feed on blood!

Edited by redLabel
Link to comment
Share on other sites

Thnx for the tip!

By the way, what i am trying to make is the following:

Display a full screen jpg and make it impossible for people to use the keyboard/mouse to go back to the desktop/applications that they were running. (and then after 10 minutes i want to auto lock the pc and stop this script from running)

Right now i am doing all this with a vbs script and the help off a appl. called: "kidkeylock" (but i would rather programme it all myself)

Link to comment
Share on other sites

  • Moderators

pbecks1963,

Display a full screen jpg and make it impossible for people to use the keyboard/mouse to go back to the desktop/applications that they were running. (and then after 10 minutes i want to auto lock the pc and stop this script from running)

I am sure you will understand if, before offering any help, I ask why you want to do this? :mellow:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Hello Melba23,

I am an system administrator at a school and i need to make a evacuation alert-message for all pc's at school that will:

-display an alert-message on all pc's

-lock the mouse and keyboard

-lock the system ("windows logo-L" on the keyboard)after 11 minutes

Right now i have the above all covered within a vbs-script but i would really like it if i had an executable (and if i wouldn't have to use "kidkeylock.exe"

ps: an additional bonus of using a executable would be that passwords i use in the script can't be read anymnore. (is safer that way)

Edited by pbecks1963
Link to comment
Share on other sites

  • Moderators

pbecks1963,

I am an system administrator at a school

In that case you know exactly why I asked! :(

As D4ni has already stated, BlockInput will stop mouse and keyboard input - but as far as I know, nothing in Autoit can block Ctrl_Alt_Delete.

Send should still work and enable you to lock after a certain period, which you can easily determine using TimerInit and TimerDiff.

To display your alert message, you could use MsgBox (a standard Windows message dialog), SplashText (a customisable popup) or perhaps my ExtMsgBox UDF (which lets you add colour and change the font size).

Are you happy to make a first cut at the code yourself - or would you like a skeleton? :mellow:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

He likes to have a fullscreen notice so I'd actually recommend a GUI as wide and high as the screen (using @ScreenWidth & @ScreenHeight) and put a GUICtrlLabel on it.

I once used this:

Func DisplayPopup()
  $popup = GUICreate("", 400, 250, -1, 10, $WS_POPUPWINDOW, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
  GUISetBkColor(0xfffacd, $popup)
  $title = GUICtrlCreateLabel("Title in bold", 85, 15, 250, 50, -1, $GUI_WS_EX_PARENTDRAG)
  GUICtrlSetFont($title, 15, 400, 4, "Comic Sans MS")
  $1 = "Lots of text #1" ; I divided the whole text in 2 parts to keep it readable and make the line not too long,
  $2 = "Lots of text #2" ; you can ofcourse just put these together in 1 variable
  $label = GUICtrlCreateLabel($1 & @CRLF & $2, 10, 75, 375, 350, -1, $GUI_WS_EX_PARENTDRAG)
  GUICtrlSetFont($label, 14, 400, 0, "Comic Sans MS")
  GUISetState(@SW_SHOW, $popup)
EndFunc ; ==> DisplayPopup()

Remember this one isn't fullscreen, but as I said you can use @ScreenWidth & @ScreenHeight when you create the GUI & the label.

Edited by d4ni
Link to comment
Share on other sites

  • Moderators

pbecks1963,

I have not forgotten you, but I have run into a problem. What OS are you using? I ask because I cannot get Vista to recognise Win-L when I send it. Vista recognises Win-R and many others, but not Win-L. I suspect UAC or something similar - Google suggests that this might be the case. I will keep trying.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

My my, lots off replies!

We use windows xp (sp3). About 150 pc's

I have a html page (local) that has the evacuation-alert (with logo of the school & exit sign graphic)

In the scripts that runs local on all pc's i have the following happening:

1) run iexplore.exe -k (kiosk mode, full screen) with the evacuation-alert html-page

2) immediatly after that i lock the mouse/keyboard with kidkeylock.exe

3) after 11 minutes i lock the pc.

So a text popup won't do it for me. I want a graphical & text message to appear on all screens.

ps: the local scripts are activated remotely (from 1 pc) with the command "psexec" (from sysinternals). I have a vbs-scripts that reads a txt-file that contains the names of the workstations and then run psexec to activate the remote script.

Edited by pbecks1963
Link to comment
Share on other sites

  • Moderators

pbecks1963,

Sorry, but as I have no experience of working with networks and am unable to test any code I might suggest to lock the machines on my Vista system, I am bowing out.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

To get around people canceling Ctrl - Alt - DEl, just have your script search for Ctrl Alt and the have it press another key other than del.

[EDIT]

Sorry for the messy post I was doing 2 things at once and trying to concentrate on both :mellow:

So Yea have your script search for both Ctrl and Alt being pressed and then have it your script to punch in another letter like G.

If you are a real admin you can disable the Ctrl - Alt - Del command through Active Directory for the network.

Edited by AgentSmith15
Link to comment
Share on other sites

Hello y'all,

I "wrote" this test-script (my first autoit script) to check if i could:

-Execute a command HIDDEN

-Execute a command with a parameter

-Block the input off the mouse & Keyboard

-make the script sleep for a while

-release the mouse & keyboard lock

Unfortunetly i am on a Windows 7 pc (right now), so Block input doesn't work (will be testint this script in a few days on a win xp pc)

Do you have any suggestions or critical observations perhaps?

************************************

BlockInput(1)

sleep(3000)

Run("C:\Program Files\Internet Explorer\iexplore.exe -k c:\page\localpage.html")

sleep(3000)

run("cmd /c dir c: /p > C:\Users\patrick\test1.txt & pause","",@SW_HIDE)

sleep(10000)

BlockInput(0)

************************************

ps: In the end i will compile this script to an executable. This executable will do the following:

-Show a full screen html-page (local on the pc) with a evacuation-alert.

-Lock the input from mouse & keyboard

-Wait for 11 minutes

-Unlock the mouse/keyboard

-Lock the pc ("windows logo-L") (hidden command execution: rundll32.exe user32.dll, LockWorkStation )

Edited by pbecks1963
Link to comment
Share on other sites

  • 6 months later...

PM sent for what I have in mind is not safe for noobs or kids who like doing bad things.

Any chance I can get that PM too. I am having issues with the BlockInput running on Windows 7 (doesn't seem to work). I am trying to change the background image (wallpaper) on a Windows 7 device, force the wallpaper to immediately refresh, and then minimize all the active windows so the end user can see the change. I work in an environment where we frequently have to change the end users wallpaper back to the company standard since end users like to change it to their own pictures/photos/whatnot. I am able to change and refresh on Windows XP without any problems with a simple bat script and windows dll calls, but those have been changed with Windows 7. After searching high and low, I finally found the right VBS script/syntax to change the wallpaper immediately on a Windows 7 device, but it's through the GUI so the end user could just click away from the active personalization window. I need to block the input from the user while the script executes and then re-enable once script is done.

Any assistance on this would be greatly appreciated.

Link to comment
Share on other sites

Any chance I can get that PM too. I am having issues with the BlockInput running on Windows 7 (doesn't seem to work). I am trying to change the background image (wallpaper) on a Windows 7 device, force the wallpaper to immediately refresh, and then minimize all the active windows so the end user can see the change. I work in an environment where we frequently have to change the end users wallpaper back to the company standard since end users like to change it to their own pictures/photos/whatnot. I am able to change and refresh on Windows XP without any problems with a simple bat script and windows dll calls, but those have been changed with Windows 7. After searching high and low, I finally found the right VBS script/syntax to change the wallpaper immediately on a Windows 7 device, but it's through the GUI so the end user could just click away from the active personalization window. I need to block the input from the user while the script executes and then re-enable once script is done.

Any assistance on this would be greatly appreciated.

A real simple way to nip that in the bud is simply use Active Directory to set the profile so that they can't change it. To keep them out, you simply prevent the user from accessing the controls to change the desktop wallpaper.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...