DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: A script/trick/code for skipping the Windows lock-screen BUT not disabling it!  (Read 18,712 times)

Techno Grub

  • Participant
  • Joined in 2018
  • *
  • Posts: 9
So much for a easily understandable thread title..

I have a certain problem that I need fixed, a certain need that I wish to fulfill, and I am hoping you guys could help me out.


A little prelude into my problem:

When booting up your Win10 PC, FIRST it will naturally go to this Lock-screen which displays 1) A static picture, 2) A slideshow of pictures or additionally 3) the "Windows Spotlight" picture. These are the three options to choose from when Customizing the Lockscreen for Windows10. Still with me? Great!


Now, personally, I like to have 2) A Slideshow of Pictures for my Lockscreen, however there is a slight problem:

When booting up the PC, the slideshow won't begin unless I login first, and then Lock the user out. OR, as I discovered, I can simply hit an arrowkey/mouse to enter the Login screen, but then simply wait for it to go back to the Lockscreen if no action is taken and amazingly enough, the Slideshow of pictures will begin.


So, in short, my desired effect is to have the Slideshow of pictures begin immediately on the Lockscreen after booting up the PC, without having to do anything else than pressing the Power-button.

A possible explanation for why the slideshow doesn't immediately begin is because Personalized Settings are not loaded on first boot-up yet, however the Personalized Settings will load with a simple arrowkey/mouseclick to enter the Login-screen, and you don't even have to log in!


What I need is a script/trick/a piece of code, or ANYTHING, to do the following:

simply have the script to press the (up) arrowkey after booting up, so that it enters the Login screen automatically (skipping the Lockscreen straight into the Login-screen), AND if no action is taken (meaning, typing your login information) it will go back to the Lockscreen, thus beginning the slideshow of pictures!

And that's it. Please, are you able to help me out? If you were even able to grasp my problem here. It may be a small problem to one, but I feel that it's important for me.

EDIT: I apologize immensely if my question/problem has already been discussed and solved even. I've done so much searching before in order to get this "fixed" but without any results, so I didn't have to energy to search these forums. I just registered and posted. Please don't ban me.

EDIT2: If a solution is possible through registry editing (regedit), that would also be perfectly fine! Please, and Thank You.
« Last Edit: April 03, 2018, 04:38 PM by Techno Grub »

Techno Grub

  • Participant
  • Joined in 2018
  • *
  • Posts: 9
Hell, a donation for anyone to come up with a working solution - even if it's something simple that I may have missed.

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Hi, Techno Grub, and welcome to the DonationCoder site.  :Thmbsup:  I'll take a look at this later tonight as see if I can come up with a working solution.

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Does C:\Windows\System32\Group Policy\Machine\Scripts\Startup still exist/work under W10?

Might be able to just put a script in there that sends a [Up Arrow] when the machine is at logon screen.

What I was using back in this thread.
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Does C:\Windows\System32\Group Policy\Machine\Scripts\Startup still exist/work under W10?

Might be able to just put a script in there that sends a [Up Arrow] when the machine is at logon screen.

What I was using back in this thread.

That's exactly what I was going to try and, if that didn't work, try running the script from the Task Scheduler.

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Just tried it with the following PoSh script but it didn't seem to work, (the script works, the GPE method didn't):

Code: ( powershell)
$wshell = New-Object -ComObject wscript.shell ; $wshell.SendKeys('{UP}')

Tried putting a sleep 20 in front also but still no joy.
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

Techno Grub

  • Participant
  • Joined in 2018
  • *
  • Posts: 9
Just tried it with the following PoSh script but it didn't seem to work, (the script works, the GPE method didn't):

Code: ( powershell)
$wshell = New-Object -ComObject wscript.shell ; $wshell.SendKeys('{UP}')

Tried putting a sleep 20 in front also but still no joy.

Thank you people for the responses and eagerness to look into my "problem".

Forgive me for being foolish, but where exactly do I apply this piece of code/script? I know, right? Silly question.

And, does it work? It seems to have something to do with the PowerShell, which I don't know what it is, so.. What do?

Techno Grub

  • Participant
  • Joined in 2018
  • *
  • Posts: 9
Does C:\Windows\System32\Group Policy\Machine\Scripts\Startup still exist/work under W10?

Might be able to just put a script in there that sends a [Up Arrow] when the machine is at logon screen.

What I was using back in this thread.

It would appear that Windows/System32/Group Policy is an empty folder, so no Machine/Scripts/Startup is found, unfortunately.

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
And, does it work? It seems to have something to do with the PowerShell, which I don't know what it is, so.. What do?

According to 4wd, it didn't work on his setup.  It's been a hectic week for me but I'm still trying to find time to try some potential solutions.

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
It would appear that Windows/System32/Group Policy is an empty folder, so no Machine/Scripts/Startup is found, unfortunately.

The directory structure is created when an entry is input via Group Policy Editor.  Group Policy directory is read-only by default anyway.

You just need to go to the appropriate entry in the editor and select a cmd/PowerShell file from anywhere, it doesn't need to reside in Windows/System32/Group Policy/Machine/Scripts/Startup ... but I couldn't get it to run.

It's been a hectic week for me but I'm still trying to find time to try some potential solutions.

Tried using Task Scheduler set as Run at startup both as myself with highest privileges and as LOCAL SERVICE with highest privileges, still didn't do anything.  Not even attempted according to the task history.

I'll try it later today with it also writing a marker file with the time inside just so I can see if it runs at all in either situation.

ADDENDUM: OK, got it to run at startup and according to the Task History it ran while the Lock Screen was being displayed but it didn't interact with the screen.
The task was apparently started 20 seconds after the Lock Screen appeared and I also had a 20 second delay, Task shows as completing successfully.
Task was set to SYSTEM user.

Now have to try specifically directing the keypress to the winlogon.exe process, might need to do this in AHK/AutoIT/etc as a compiled program.

Was testing this on my laptop and forgot to turn off Start the task only if the computer is on AC power for initial test ...  :-[

Following ran but didn't interact either:
Code: ( powershell)
(New-Object -ComObject WScript.Shell).AppActivate((get-process winlogon).MainWindowTitle)
(New-Object -ComObject wscript.shell).SendKeys('{UP}')
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903
« Last Edit: April 06, 2018, 01:31 AM by 4wd »

Techno Grub

  • Participant
  • Joined in 2018
  • *
  • Posts: 9
It seems my request is not as simple as I thought.. Have you tried telling the script to hit the up-arrowkey twice, perhaps?

And it can be a mouseclick too, if that makes any difference. Other keys work to swipe away the Lockscreen as well..

Anyways, I appreciate all the help guys! If a solution can be found through some magic and/or trickery, I'd be happy

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
It seems my request is not as simple as I thought.. Have you tried telling the script to hit the up-arrowkey twice, perhaps?

The problem is the Lock Screen is not designed to be interacted with using a program, I think that would kind of defeat the purpose in using it to secure Windows.

There appear to be ways around it by replacing some system files but that also compromises security.

I think that if the keypress can be made so that it appears to come from the keyboard buffer then it'll work, (SendKeys uses Windows messages from what I understand).
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

Techno Grub

  • Participant
  • Joined in 2018
  • *
  • Posts: 9
I think that if the keypress can be made so that it appears to come from the keyboard buffer then it'll work, (SendKeys uses Windows messages from what I understand).

I see. So, how should I proceed in order to set this up?

Instructions&help would be greatly appreciated.

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
I think that if the keypress can be made so that it appears to come from the keyboard buffer then it'll work, (SendKeys uses Windows messages from what I understand).

I see. So, how should I proceed in order to set this up?

The program needs to be written first.

Is this a laptop or desktop computer?

Is it a PS/2 or USB keyboard, (and is there only one)?
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

Techno Grub

  • Participant
  • Joined in 2018
  • *
  • Posts: 9
The program needs to be written first.

Is this a laptop or desktop computer?

Is it a PS/2 or USB keyboard, (and is there only one)?

An entire program has to be written? Alright.

Also, I am so sorry for a late reply. All kinds of things going on in life.

It is a desktop computer, and it is a USB keyboard, one keyboard, at least currently it's USB and I believe it will stay as such in the future.

Is this not too much of trouble for you? I was hoping there would be a low-effort solution to my problem, but apparently not!

Techno Grub

  • Participant
  • Joined in 2018
  • *
  • Posts: 9
I think that if the keypress can be made so that it appears to come from the keyboard buffer then it'll work, (SendKeys uses Windows messages from what I understand).

It's been a while, but I must ask you guys again if there was some relatively simple solution to this?

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
I think that if the keypress can be made so that it appears to come from the keyboard buffer then it'll work, (SendKeys uses Windows messages from what I understand).

It's been a while, but I must ask you guys again if there was some relatively simple solution to this?

Not from me atm, was looking at possibly using Interception to hook into the IO but unfortunately it's geared to not inject keystrokes until one has been received, (why I asked what type of keyboard, so I could set the appropriate variables).

Here's an old Dr Dobbs article about Controlling the Keyboard Buffer from 1990, no idea if it's workable today ... me and C don't get along without a fight.
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 11,205
    • Participated in NANY Challenge Fourteen Times
    • Coding Snacks
    • Writer
    • Hardware Hacker
I think that if the keypress can be made so that it appears to come from the keyboard buffer then it'll work, (SendKeys uses Windows messages from what I understand).

It's been a while, but I must ask you guys again if there was some relatively simple solution to this?

I don't think that without someone writing something, there will be a relatively simple solution to this problem.  It pretty much goes against what the windows protection screen is intended to do, i.e. force the user to interact in order to get to the login.  This issue with the lock screen is real, but just not resolved.

A post from Zachd from Microsoft
Quote
Howdy!  I wrote this code.  You mentioned that the Slideshow always "starts with" the last selected image under Lock Screen -> Background -> Picture.  That is incorrect.  Instead, please understand that the Lock Screen -> Background -> Picture image is shown until the Slideshow itself is ready to start.

This is a feature of the slideshow and how it works.  It is impossible to not have it work this way.  I understand what you're going for here, but -- that is not how it works.  We try to optimize as much as we can, but until the Lock Screen Slideshow has loaded things up and is ready to go we display the selected Picture.  Otherwise you'd be seeing nothing at all for that duration, and that's no fun. :)

Cheers!

Windows development team
Speaking for myself only.

Quote
Is this when the system is locked or when you fully reboot the system?  When the system is restarted, or when a user logs out, the default picture (the cave) is used until a user logs in.

Windows development team
Speaking for myself only.

The quotes are from this thread; there might be some useful information there.

HTH

Techno Grub

  • Participant
  • Joined in 2018
  • *
  • Posts: 9
It would appear that a recent Windows 10 update fixed this "problem"

Now, when I boot up my computer by pressing the Power-button, the slide-show will begin immediately, and it also loads the Personalized Settings immediately (i.e. weather information)

So, I want to say thank you for looking into the problem, but it fixed itself.

Now, every time I power up my PC, I am greeted by a slideshow of beautiful, official box art pictures of demons from DOOM (2016). I am a happy super-nerd now, and my girlfriend is like "Ughh. That one demon is pretty cute tho."

Original address: https://www.donationcoder.com/forum/index.php?topic=45313.0