WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Sending Keystrokes

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Sending the Ctrl and Ctrl-Alt-Del Keys

Keywords:    control key CTRL  ctrl alt del ctrl-alt-del

Question:

We also seem to have problems with SendKeys() sending a ctrl-alt-delete to activate the Windows panel so we can enter the screen saver password once the PC is locked. I wonder if Microsoft has disabled ctrl-alt-del unless it comes directly from the keyboard once the PC is locked?

How do I use Sendkeysto to send the Ctrl key by itself?

Answer:

Sorry. You CANNOT send the CTRL-ALT-DELETE sequence using Sendkeys. Ctrl-Alt-Del causes a hardware interrupt to occur, via direct wiring from the keyboard. It is a hardware interrupt generated by the keyboard. It's not the CTRL-ALT-DEL keystroke that is the problem, but that the keyboard makes a special type of hardware interrupt request to the cpu that SendKey cannot duplicate.

The question is, why do you want the ctrl alt delete?

  1. If you want to shutdown, there are a number of reskit and shareware utils around, as well as Intcontrol 66, 67, or 68.

  2. If you want to logoff or change password, Winbatch will let you do that.

  3. If you want to run taskmanager run taskmgr.exe.

  4. If you want to lock the screen, locate and run the screensaver (or better yet, put it in a policy). Note that the SendKey code emulates the keyboard. If the workstation is locked, you cannot use SendKeys.

You can't send the CTRL key by itself. You can ONLY send the Control key in conjunction with another key. For example:

	Sendkeysto("MS Word", "^v")
where the caret "^" is the control key.
Article ID:   W13829
Filename:   Sending CTRL and Ctrl-Alt-Del Keys.txt
File Created: 1999:04:15:16:56:40
Last Updated: 1999:04:15:16:56:40