BlockInput password

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

BlockInput password

Post by JRL » Mon Nov 26, 2007 2:54 pm

Currently Blockinput can be used to stop users from interfering with a running script. A knowledgable person can use Ctrl+Alt+Del to kill Blockinput and I think this a necessary feature. If there is currently a way to password protect the Ctrl+Alt+Del kill of blockinput I haven't found it. I would like a feature for password protecting blockinput. Perhaps it could be a second parameter?

Thanks for listening,
Dick

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Nov 26, 2007 4:02 pm

I don't believe that is possible. Would involve somehow trapping/blocking CTRL+ALT+DELETE which may not be possible.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Nov 26, 2007 4:34 pm

I can sort of do it using:

Code: Select all

OnEvent>WINDOW_OPEN,Task Manager*,0,PassWord
SRT>PassWord
  SetFocus>Task Manager*
  Press Esc
  BlockInput>1
END>PassWord
I'd have to somehow pop a dialog in the PassWord subroutine that allows a password to be typed and maybe have another handler that sets blockinput back to 1 if the password dialog is not the active window. But this scenario only works in Windows XP. Win 2000 or Windows Vista have that secondary screen that pops up on Ctrl+alt+del rather than simply popping Task Manager.

Also:
I just started experimenting with Vista. I made a blockinput test script that runs for 10 seconds so I could test my attempts at password protecting blockinput. I compiled that and ran it on the Vista machine. The first line is BlockInput>1 but no input is blocked when I run the executable in vista. Macro Scheduler has never been installed on this Vista box. Heres the test script.

Code: Select all

BlockInput>1
OnEvent>WINDOW_OPEN,Task Manager*,0,PassWord

VBSTART
VBEND
VBEval>timer,starttime
Message>
Label>start
VBEval>timer,nexttime
Wait>0.01
Let>diff=%nexttime%-%starttime%
If>%diff%>10,EOF
SetControlText>Macro Scheduler Message*,TMemo,1,%nexttime%%CRLF%%diff%
goto>start

Label>EOF
BlockInput>0

SRT>PassWord
  //Wait>0.001
  SetFocus>Task Manager*
  Press Esc
  BlockInput>1
END>PassWord
Thanks for your time,
Dick

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Nov 26, 2007 4:48 pm

For BlockInput to work in Vista the script needs to run as admin (the exe or Macro Scheduler need to be run as admin).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Nov 26, 2007 5:01 pm

Which of course is no help whatsoever, as I imagine most people want to use BlockInput so that regular users don't mess up an automation process. Unfortunately Microsoft have deemed it naughty to block input so the process needs to run as Admin for it to work. Which of course is no use when the person running the process is an ordinary user. Thanks Microsoft.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Nov 26, 2007 5:03 pm

For BlockInput to work in Vista the script needs to run as admin (the exe or Macro Scheduler need to be run as admin).
Thank you, I didn't know that. Come to think of it, there's another enhancement request. Add this info to help :wink:

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Nov 26, 2007 5:08 pm

In cases where I have macros that require admin privs (and UAC is enabled) what I normally do is create a macro to do the admin bit, compile it and then right click on the compiled EXE and select properties and in there mark it to always run as admin.

If I then call this macro from another with Run> it will run only that macro as admin.

A workaround until the RunAsAdmin function is available .....
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts