Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can this be done?

Status
Not open for further replies.

rickgerdes

IS-IT--Management
Feb 11, 2003
44
US
Hello folks,

Hopefully a simple question, but likely not.
Should it be possible to write a script to be called by an external task scheduler that sends a ctrl-alt-del?

I've been looking at various Win32 modules and it looks as if the pieces are there, but I'm a total novice at perl so I can't fit the puzzle together.

Thanks in advance.

Rick Gerdes.
 
Additional data-

Using Win32::GUITest and it's SendKeys, I can send any two keystrokes simultaneously, but not three. The code I'm trying is:

use Win32::GuiTest qw/SendKeys/;
SendKeys("^%{ESCAPE}");

I've tried a few combinations invovling grouping keys with parenthesis, but to no avail. Ideas?
 
According to all other SendKeys documentation I could find, that's supposed to work. At worst, "^(%{ESCAPE})" should do it, but it doesn't seem to work here, either. Either I'm missing something big, or the perl implemenation doesn't seem to support it. Also, it kept some keys, like CTRL or SHIFT, pressed after running a test script. Trying to do anything in windows acted as if the keys were still down. Pounding on the keyboard a bit made it go away, but it makes me think this module isn't quite bug-free yet.

Sorry I couldn't help.

----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 
For what it's worth, +^{ESCAPE} works to launch the task manager. It must be windows blocking the combo from working. Back to the drawing board.

Thanks for the thought.
 
Rick,
CTRL-ALT-DEL is a key combination that can't be generated, which is why its used to indicate an interactive session. It's a security thing, I think I read it in the DoD Orange Book on security

HTH
Paul
 
Since I know of two applications that can unlock NT, I'm not convinced. PCAnywhere can send a C-A-D, and there is at least one windows scheduler that will unlock a session, of course we don't have a license for _that_ one...

 
CTRL+ALT+DEL should be able to be generated by a program, just not captured. That's the security issue, the operating system always handles that message, so after sending it, you can be assured you're really talking to the OS. At least in theory.

----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 
Not to sure if this will help you, but this is what I am doing to get around the same situation. I recently began incorporating AutoIt scripts in with my perl scripts. See:


for the software. You can create the AutoIt script, have perl copy and execute it, then do as you like.

HTH - Mike

And it is a freeware
 
Looks like a nice and simple program, with one problem. From the help file:

One thing to remember about NT/2K. Even if you have an autoit script running, it cannot do the CTRL+ALT+DEL needed to get to the logon dialog.

Which is the only thing I really need. <sigh>

And the search continues. Thanks for the thought!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top