Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Trying to use SendKeys() to hit Ctrl-Alt-Del

3,840 views
Skip to first unread message

No-Spam

unread,
Mar 18, 2001, 1:59:23 AM3/18/01
to
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})")


wmf

unread,
Mar 18, 2001, 8:36:47 AM3/18/01
to
SendKeys("{^}{%}{DEL}")

"No-Spam" <nos...@nospam.com> wrote in message
news:3ab45c24....@msnews.microsoft.com...

wmf

unread,
Mar 18, 2001, 9:13:29 AM3/18/01
to
forget it, that doesn't work

"wmf" <wmf...@hotmail.com> wrote in message
news:OqKy7B7rAHA.2344@tkmsftngp05...

No-Spam

unread,
Mar 19, 2001, 1:01:46 AM3/19/01
to

There's not a single word at the URL you referenced about how
Ctrl-Alt-Del is specifically ignored -- it's not there now, and it
wasn't there when I read the documentation before posting the question
to this newsgroup.

>When you encounter a problem with a object/property/method, it often helps to refer back to its
>documentation. This can sometimes save you a lot of frustrating minutes or hours trying to do
>something that *can't* be done. For example, take the SendKeys documentation. It clearly states that
>the system ignores the Ctrl-Alt-Del combination.
>
>http://msdn.microsoft.com/scripting/windowshost/doc/wsMthSendKeys.htm


>
>
>"No-Spam" <nos...@nospam.com> wrote in message news:3ab45c24....@msnews.microsoft.com...

jim_w

unread,
Mar 19, 2001, 2:50:31 PM3/19/01
to
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

"No-Spam" <nos...@nospam.com> wrote in message
news:3ab45c24....@msnews.microsoft.com...

No-Spam

unread,
Mar 19, 2001, 6:53:50 PM3/19/01
to

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!

0 new messages