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

automatically unlock a workstation?

953 views
Skip to first unread message

Tex

unread,
Nov 17, 2004, 3:17:29 PM11/17/04
to
Is there a way to automatically unlock a workstation? I'm familiar with the
rundll32 user32.dll LockWorkStation command to lock a workstation. However,
there appears to be no reverse function.

I have seen a couple commercial apps which can do it, so there must be a
way.

- tex


Pegasus (MVP)

unread,
Nov 17, 2004, 3:31:50 PM11/17/04
to

"Tex" <t...@aspam101.org> wrote in message
news:vMqdnR4OG5h...@comcast.com...

Disable the screen saver!

If you need some program to execute at a specific time, even if the
machine is locked, use the Task Scheduler. It does not care about
the locked/unlocked status.


Ted Davis

unread,
Nov 17, 2004, 4:51:15 PM11/17/04
to
On Thu, 18 Nov 2004 07:31:50 +1100, "Pegasus \(MVP\)" <I....@fly.com>
wrote:

I don't see that as a viable answer - it's not even possible in most
cases since screen saver settings are in the user profile and it's not
the logged in user who needs to break the lock.


T.E.D. (tda...@gearbox.maem.umr.edu)
SPAM filter: Messages to this address *must* contain "T.E.D."
somewhere in the body or they will be automatically rejected.

Mark V

unread,
Nov 17, 2004, 5:13:17 PM11/17/04
to
In alt.msdos.batch.nt Tex wrote:

Do they perhaps replace or chain the GINA?

Tex

unread,
Nov 17, 2004, 5:23:34 PM11/17/04
to
"Pegasus (MVP)" <I....@fly.com> wrote in message
news:cngcfn$2fo6$1...@arachne.labyrinth.net.au...
> Disable the screen saver!

Perhaps I should have given a better explanation. I need to run a scheduled
application which sends keypresses to another running application. It works
fine when the screen is not locked, but fails when the screen is locked.

Of course, you are right, it would be easiest to not lock the screen the
screen at all. However given that it's a server we don't like to keep the
console freely exposed. Certain applications must run at the console and
cannot simply run as a service, unfortunately and so we have to keep the
screen locked from prying hands/eyes.

> If you need some program to execute at a specific time, even if the
> machine is locked, use the Task Scheduler. It does not care about
> the locked/unlocked status.

Unfortunately, it's not that simple, as explained above.

- tex


Reinhardt Kern

unread,
Nov 17, 2004, 5:24:54 PM11/17/04
to
"Tex" <t...@aspam101.org> wrote:

Hi Tex,
I never had the need for this. My idea: What happens when you
kill the screen saver process?

best regards,
Reinhardt
--
Die finnische Regierung laesst zum wiederholten Male mitteilen,
dass alte Lappen nicht bedenkenlos weggeworfen werden sollten.

Tex

unread,
Nov 17, 2004, 7:44:55 PM11/17/04
to
"Mark V" <notv...@nul.invalid> wrote in message
news:Xns95A4AFAFEB...@216.77.188.18...

That's a good question...but I doubt that it does this, no reboot required
on install.

See: http://www.splinterware.com/products/wincron.htm

The free version unfortunately lacks the unlock feature. $30 isn't very
much money, but I will need to do this on many machines so it will add up.

I installed the professional version and it appears to use a service to do
it's work. I tried simply running it in console mode and it couldn't unlock
the pc. Switching to service mode allowed it to do the unlock "magic".

- tex


Tex

unread,
Nov 17, 2004, 7:51:23 PM11/17/04
to
"Reinhardt Kern" <Reinhar...@gmx.de> wrote in message
news:krjnp0lhboi9q8bln...@4ax.com...

> "Tex" <t...@aspam101.org> wrote:
>
>>Is there a way to automatically unlock a workstation? I'm familiar with
>>the
>>rundll32 user32.dll LockWorkStation command to lock a workstation.
>>However,
>>there appears to be no reverse function.
>>
>>I have seen a couple commercial apps which can do it, so there must be a
>>way.
>>
> Hi Tex,
> I never had the need for this. My idea: What happens when you
> kill the screen saver process?

I'm not sure what process is running the screen saver, however I think even
if you did kill it, windows will still drop back to the logon screen.

- tex


Ted Davis

unread,
Nov 17, 2004, 8:43:32 PM11/17/04
to

There might be a work around - if the apps you need to run are console
apps and meet some other constraints, you might be able to run them
remotely on the server with PsExec.
psexec \\machine_name cmd
gets you a cmd prompt that runs on the remote machine but has its user
interface on your desktop. It can accept a username and prompt for a
password.


--
T.E.D. (tda...@gearbox.maem.umr.edu)

Mark V

unread,
Nov 18, 2004, 5:46:12 AM11/18/04
to
In alt.msdos.batch.nt Tex wrote:

So, if I understand this you have a user-interactive GUI application
running on a server console that
May/will need "user keystokes" entered into it during operation.
(or possibly at scheduled execution time)
Have a SS running and locked
Have no inherent ability to avoid entering keystrokes interactively
by way of starting the application with such as "/silent" or similar
or feed it arguments on the initial command line.
Cannot have the applications re-written.
Cannot run the application on another machine.

The requirement is one of
Lower the locked SS programmatically.
SendKeys() while the SS is active.

Not that I have any immediate answer but does above describe the
situation?



Mark V

unread,
Nov 18, 2004, 6:08:29 AM11/18/04
to
In alt.msdos.batch.nt Tex wrote:

I am wondering it AutoIt v3 might help?
http://www.hiddensoft.com/autoit3

"Directly get information on and interact with edit boxes, check
boxes, list boxes, combos, buttons, status bars without the risk of
keystrokes getting lost. Even work with controls in windows that
aren't active!"

Tex

unread,
Nov 18, 2004, 8:08:35 AM11/18/04
to
"Mark V" <notv...@nul.invalid> wrote in message
news:Xns95A53AD987...@216.77.188.18...

> In alt.msdos.batch.nt Tex wrote:
>
> So, if I understand this you have a user-interactive GUI application
> running on a server console that
> May/will need "user keystokes" entered into it during operation.
> (or possibly at scheduled execution time)
> Have a SS running and locked
> Have no inherent ability to avoid entering keystrokes interactively
> by way of starting the application with such as "/silent" or similar
> or feed it arguments on the initial command line.
> Cannot have the applications re-written.
> Cannot run the application on another machine.
>
> The requirement is one of
> Lower the locked SS programmatically.
> SendKeys() while the SS is active.

General process to accomplish what I'm trying to do:

1) unlock screen
2) sendkeys
3) relock screen

The only problematic/tough part is getting the screen to unlock
programmatically.

> Not that I have any immediate answer but does above describe the
> situation?

Yes. Note: The running app itself does have keyboard macro level
functionality to do what i need it to do, but b/c it too is keyboard based,
it suffers from the same problem, ie, that the screen saver/screen lock
prevents it from receiving the keystrokes.

Unfortunately, it's a commercial app so it's functionality cannot be
modified in house.

SendKeys does not work with screen locked. As I understand it, the
CTRL-ALT-DEL used to initiate the screen unlock process works at the
hardware interrupt level.

- tex


Reinhardt Kern

unread,
Nov 18, 2004, 2:47:15 PM11/18/04
to
"Tex" <t...@aspam101.org> wrote:

>"Reinhardt Kern" <Reinhar...@gmx.de> wrote in message
>news:krjnp0lhboi9q8bln...@4ax.com...
>> "Tex" <t...@aspam101.org> wrote:
>>
>>>Is there a way to automatically unlock a workstation? I'm familiar with
>>>the
>>>rundll32 user32.dll LockWorkStation command to lock a workstation.
>>>However,
>>>there appears to be no reverse function.
>>>
>>>I have seen a couple commercial apps which can do it, so there must be a
>>>way.
>>>

>> I never had the need for this. My idea: What happens when you
>> kill the screen saver process?
>
>I'm not sure what process is running the screen saver, however I think even
>if you did kill it, windows will still drop back to the logon screen.
>

Hi Tex,

use "tasklist >file.txt" to get a list of processes.

The name of the screensaver process should be named as the result
of

reg query "HKEY_CURRENT_USER\Control Panel\Desktop" | find
"SCRNSAVE.EXE"

Tex

unread,
Nov 18, 2004, 4:39:22 PM11/18/04
to
"Reinhardt Kern" <Reinhar...@gmx.de> wrote in message
news:isupp056ofld7jf3q...@4ax.com...

> "Tex" <t...@aspam101.org> wrote:
>
>>"Reinhardt Kern" <Reinhar...@gmx.de> wrote in message
>>news:krjnp0lhboi9q8bln...@4ax.com...
>>> "Tex" <t...@aspam101.org> wrote:
>>>
> use "tasklist >file.txt" to get a list of processes.

Compared with screen locked and unlocked...only ntvdm.exe appeared. Not a
process I want to kill.

> The name of the screensaver process should be named as the result
> of
>
> reg query "HKEY_CURRENT_USER\Control Panel\Desktop" | find
> "SCRNSAVE.EXE"

No luck here. Not in registry.

- tex


Mark V

unread,
Nov 18, 2004, 4:39:21 PM11/18/04
to
In alt.msdos.batch.nt Tex wrote:

> "Mark V" <notv...@nul.invalid> wrote in message
> news:Xns95A53AD987...@216.77.188.18...
>> In alt.msdos.batch.nt Tex wrote:
>>
>> So, if I understand this you have a user-interactive GUI
>> application running on a server console that
>> May/will need "user keystokes" entered into it during operation.
>> (or possibly at scheduled execution time)
>> Have a SS running and locked
>> Have no inherent ability to avoid entering keystrokes
>> interactively by way of starting the application with such as
>> "/silent" or similar or feed it arguments on the initial command
>> line. Cannot have the applications re-written.
>> Cannot run the application on another machine.
>>
>> The requirement is one of
>> Lower the locked SS programmatically.
>> SendKeys() while the SS is active.
>
> General process to accomplish what I'm trying to do:
>
> 1) unlock screen
> 2) sendkeys
> 3) relock screen
>
> The only problematic/tough part is getting the screen to unlock
> programmatically.

Unless (maybe) you can send messages directly to the application's
windows controls (and not SendKeys() per se) while the SS is raised
(and locked). _Possibly_ AutoIt3 can do that. I do not know though
as I last used version 2. Depending on schedule here I can look into
it within a few days I think.

>
>> Not that I have any immediate answer but does above describe the
>> situation?
>
> Yes. Note: The running app itself does have keyboard macro level
> functionality to do what i need it to do, but b/c it too is
> keyboard based, it suffers from the same problem, ie, that the
> screen saver/screen lock prevents it from receiving the
> keystrokes.
>
> Unfortunately, it's a commercial app so it's functionality cannot
> be modified in house.
>
> SendKeys does not work with screen locked. As I understand it,
> the CTRL-ALT-DEL used to initiate the screen unlock process works
> at the hardware interrupt level.

We are back to MSGINA for the SAS (secure attention signal aka C-A-D)
handling which to my current understanding cannot be bypassed.


Tex

unread,
Nov 18, 2004, 5:45:30 PM11/18/04
to
"Mark V" <notv...@nul.invalid> wrote in message
news:Xns95A5A99709...@216.77.188.18...

> In alt.msdos.batch.nt Tex wrote:
>
>> "Mark V" <notv...@nul.invalid> wrote in message
>> news:Xns95A53AD987...@216.77.188.18...
>>> In alt.msdos.batch.nt Tex wrote:
>>>
> Unless (maybe) you can send messages directly to the application's
> windows controls (and not SendKeys() per se) while the SS is raised
> (and locked). _Possibly_ AutoIt3 can do that. I do not know though
> as I last used version 2. Depending on schedule here I can look into
> it within a few days I think.

Not sure. Per your suggestion, I had checked the AutoIT's forums and found
that users had indicated that they were unable to get it to unlock locked
screens.

As a further follow up note, I did some further investigation and found the
following:

http://www.codeproject.com/system/alt_control_delete.asp

He has a sample app which I managed to get running...it worked. ie, I got
it to successfully send a C-A-D to the locked screen window. I had to
initiate it as a system service (using a service making tool i have). I
think it works by running as the LocalSystem account.

- tex


Tex

unread,
Nov 18, 2004, 5:48:08 PM11/18/04
to
"Tex" <t...@aspam101.org> wrote in message
news:FLCdnRkR55m...@comcast.com...

For clarification...it worked only insofar as it sent a C-A-D to the screen
(thus presenting the login prompt)...it does _not_ actually take the next
step of entering the password and then hitting enter.

I unfortunately don't know C++ so his source code isn't of much use to me.

- tex


Mark V

unread,
Nov 18, 2004, 7:27:40 PM11/18/04
to
In alt.msdos.batch.nt Tex wrote:

> "Mark V" <notv...@nul.invalid> wrote in message
> news:Xns95A5A99709...@216.77.188.18...
>> In alt.msdos.batch.nt Tex wrote:
>>
>>> "Mark V" <notv...@nul.invalid> wrote in message
>>> news:Xns95A53AD987...@216.77.188.18...
>>>> In alt.msdos.batch.nt Tex wrote:
>>>>
>> Unless (maybe) you can send messages directly to the
>> application's windows controls (and not SendKeys() per se) while
>> the SS is raised (and locked). _Possibly_ AutoIt3 can do that.

[ ]


> Not sure. Per your suggestion, I had checked the AutoIT's forums
> and found that users had indicated that they were unable to get it
> to unlock locked screens.

I should have checked. Just did a simple trial and the SendKrys
limitation appears to apply to AutoIt3 as well. With a locked
winstation the actual keys were not sent until unlocking.

>
> As a further follow up note, I did some further investigation and
> found the following:
>
> http://www.codeproject.com/system/alt_control_delete.asp
>
> He has a sample app which I managed to get running...it worked.
> ie, I got it to successfully send a C-A-D to the locked screen
> window. I had to initiate it as a system service (using a service
> making tool i have). I think it works by running as the
> LocalSystem account.

Interesting. Thanks for mentioning it.

Mark V

unread,
Nov 20, 2004, 2:30:38 PM11/20/04
to
In alt.msdos.batch.nt Tex wrote:

Tex, FWIW I bounced this off some people elsewhere and they suggest
under the circumstances that the best approach would be to attempt to
send messages (not keystrokes) to the application even if the
workstation is locked. Rather dependent apparently though on the
specifics of your application. The suggestion was (in part) any
language that has access to the Win32 APIs such as SendMessage. VBS
might be a possibility.

Some suggested that AutoIt3 might be capable as it has several
(unfamiliar to me) "send*" functions that might work. A VB, VBS or
other programming forum might be worth a post. And assuming you have
no in-house programmers available.

Good luck.

0 new messages