How do I simulate Ctrl+Alt+Del?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to execute some tasks on my servers during night. My scripts need the
windows session to be open. The problem is that the sessions on the servers
are locked during night (or whenever we are not using them).

I tried to put my script in the task scheduler, but it didn't run when it
was supposed to, the scheduler says that it couldn't start, probably because
the session was locked.

What I need is a way to simulate the Ctrl+Alt_Del buttons to open/unlock the
session so I could run my script on my server. Anybody got an idea?

Thanks for helping,

KD
(e-mail address removed)
 
KD said:
I need to execute some tasks on my servers during night. My scripts need the
windows session to be open. The problem is that the sessions on the servers
are locked during night (or whenever we are not using them).

I tried to put my script in the task scheduler, but it didn't run when it
was supposed to, the scheduler says that it couldn't start, probably because
the session was locked.

What I need is a way to simulate the Ctrl+Alt_Del buttons to open/unlock the
session so I could run my script on my server. Anybody got an idea?

Thanks for helping,

KD
(e-mail address removed)

The Task Scheduler is not affected by any locked sessions - its tasks
run in the background. The usual reason for its tasks not running is an
invalid account name / password. Reset them for your task and it will
most likely run.
 
Do you means that your script really need to interact with the UI? As what
Pegasus said, if the script is independent to the UI, or even user
information, there should have no problem even the user is not logged on.

However, if you really want to know how to simulate key stroke, even this
does not work for your case, you can use the following WSH code by saving
them into *.VBS file and execute:
==============
Dim oWsh
Set oWsh = CreateObject("WScript.Shell")
oWsh.sendKeys "^{ESC}" REM This will send a {Ctrl}+{Escape} to your
Explorer and pop up your start menu
==============

Please refer to
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthsendkeys.asp

PS: but I tried, needly everything special key will work except the
combination of {Ctrl} + {Alt} + {Del}, as Microsoft seems like to protect
this keystroke from easy execution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top