
Trying to use SendKeys() to hit Ctrl-Alt-Del
Thanks, but it was to do a "Lock Computer" without using RunDLL32.exe
like in the following:
Set wshShell = WScript.CreateObject("WScript.Shell")
wshShell.Run "RunDll32.exe user32.dll,LockWorkStation"
Also, I wanted to experiment with a Group Policy startup script that
would hit Ctrl-Alt-Del, logon, etc. and see if it would actually work.
I know about the auto-logon registry feature that does the same thing,
but I thought it would be interesting to see about this for fun....
Thanks Anyway!
On Mon, 19 Mar 2001 14:50:31 -0500, "jim_w"
Quote:
>hi no-spam,
>Why do you want to ctrl-alt-del? AFAIK, there could be only two reasons:
> - you want to shut down, or...
> - you want to terminate a misbehaving app.
>You can do both of those from script.
>There have been countless examples of how to shutdown or restart posted in
>the wsh+vbs newsgroups. You can search the archives with deja or google.
>In addition, there have been countless examples of how to terminate an app.
>Sendkeys alt-F4 usually works, as does the wmi process.terminate method.
>cheers, jw
>> Hello:
>> I'm trying to use SendKeys() to hit Control-Alt-Delete, but I can't
>> get it to work. I've tried a number of variations on the following,
>> but with no success-- any suggestions?
>> Thanks!
>> Set wshShell = WScript.CreateObject("WScript.Shell")
>> wshShell.SendKeys("^(%{DEL})")