INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Logging into Windows automatically  (Read 639 times)

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10851
  • Dogs of the world unite!
Logging into Windows automatically
« on: March 13, 2024, 09:39:10 am »

Our users have asked us to implement running TV recording in system service without logging into a user account many years ago, we told them no.

Recently this question was brought up again:

https://yabb.jriver.com/interact/index.php/topic,137502.msg953128.html#msg953128

Is the answer still "no"?

The main issue with our current approach (of not running TV recording in a system service) is when the computer has to automatically reboot due to crashes (of any app) or any other reasons.  Without logging into a user account, MC does not run, and thus all scheduled TV recordings will not happen.  This is not great for some users who take their TV shows seriously.  If they go on vacation for a few days, and come back finding their favorite shows not recorded, it is a bummer.

I don't really know how much work this will involve, probably a lot, and not even if this is feasible with our current MC structure.

It seems that there is a way of configuring Windows to automatically log into an user account, is it true?  And can the account be automatically locked after logging in? 

If we can not implement running in a service, this might provide a work around.
Logged
Yaobing Deng, JRiver Media Center

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2918

It seems that there is a way of configuring Windows to automatically log into an user account, is it true?  And can the account be automatically locked after logging in?

Yes, I have been doing this for MC for a long time.  You have to add a command to the startup programs to lock the PC but it seems to work pretty well.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10851
  • Dogs of the world unite!

Yes, I have been doing this for MC for a long time.  You have to add a command to the startup programs to lock the PC but it seems to work pretty well.

That sounds good, at least it will provide a good alternative.

Can you give me more details?  Does it work for all Windows versions (like Windows 8, Windows 10, Windows 11)?
Logged
Yaobing Deng, JRiver Media Center

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2918

Can you give me more details?  Does it work for all Windows versions (like Windows 8, Windows 10, Windows 11)?

Not sure about 8 but definitely works in 10 and 11.  I can share a shortcut that locks the PC.  Auto login is done normally through Windows.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10851
  • Dogs of the world unite!

I just configured my Windows 10 computer to automatically log into my account.  That is good.  Now I will just need to get it locked so no one else can mess with my computer.
Logged
Yaobing Deng, JRiver Media Center

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10851
  • Dogs of the world unite!

I created a .cmd file and put this line in it:

Code: [Select]
rundll32.exe user32.dll,LockWorkStation
and then put a shortcut of this file in my Startup folder.

It works, except that it took 25 to 30 seconds to actually lock my computer after automatic login.

Craig, is this how you do it?

I think there are too many different apps that try to start up, and this computer is slow.  Is there a way of picking which program to start first?  30 seconds is plenty of time for a malicious person to try to do some damage to a computer.
Logged
Yaobing Deng, JRiver Media Center

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2918

I created a .cmd file and put this line in it:

rundll32.exe user32.dll,LockWorkStation

and then put a shortcut of this file in my Startup folder.

It works, except that it took 25 to 30 seconds to actually lock my computer after automatic login.

Craig, is this how you do it?

Yes, but I just make a shortcut in Startup and use that command directly in the shortcut.  I'm not sure about timing.  Did you put it in the Start Menu/Programs/Startup folder?  Anything else in there?
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2918

You could try to create a task in the Task Scheduler to be run "when the computer starts" and see if that works.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10851
  • Dogs of the world unite!

In this folder:

C:\Users\[user]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

There are no other items.

I will try scheduler.

By the way, this is how to get to that folder quickly:

Press 'r' while holding down the Windows Key, to bring up the "Run" dialog window, and type "shell:startup" in the "Open:" box, and press OK.
Logged
Yaobing Deng, JRiver Media Center

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10851
  • Dogs of the world unite!

I sort of got this to work using Task Scheduler, but it is a bit tricky.

When I initially created a task, I picked "At Log on" as the trigger.  The result was weird.  After rebooting, the computer logs in automatically and ends up in a APPARENT locked state - with locked screen showing (instead of the Desktop showing), but a mouse-click reveals the Desktop.  So it is not locked.  I think probably the script was executed before Automatic log in, and the subsequent log in just unlocked it.

After some trial and error, I found that making a delay of 10 - 15 seconds will make it work.
Logged
Yaobing Deng, JRiver Media Center

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2918

I think it depends on the startup speed of the computer.  I do the Startup shortcut method on my server and it locks in about 15 seconds after login.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10851
  • Dogs of the world unite!

I am aware that this work around is not a perfect solution as it only addresses the issue of computer rebooting.  If you log out of your account and forget to log back in, TV recording will not happen.  But this is better than not having a work around.
Logged
Yaobing Deng, JRiver Media Center

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2362
Re: Logging into Windows automatically
« Reply #12 on: March 15, 2024, 05:04:51 pm »

There's a policy setting that does exactly that:
https://winaero.com/configure-automatic-sign-in-and-lock-after-restart-in-windows-10/amp/

It can also be enabled by registry key.

Note that the desktop is never actually shown, but it does in fact login in the background.
Logged

markf2748

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 679
Re: Logging into Windows automatically
« Reply #13 on: March 15, 2024, 05:06:00 pm »

I have never understood exactly what these Windows processes do, and whether they are in fact the same process or not:

Windows Services:  JRiver Media Center 32 Service
Task Manager: Media Center Service (JRService.exe)

Like any Windows service, the first can be set to Startup Type: Manual | Automatic | Automatic (Delayed Start) | Disabled

I always find them running (I have set MC Options > Startup > Windows Startup > Run on Windows startup: Media Center and Media Server).  They seem (?) to enable Remote Players to connect to JRiver, even before Windows login and after remotely waking up Server PC from sleep (again, without re-logging in). 

So I am just wondering, from total ignorance, if there is any leverage here to solve the TV recording problem.  Or is this what Yaobing means by "running in a service"?
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10851
  • Dogs of the world unite!
Re: Logging into Windows automatically
« Reply #14 on: March 15, 2024, 06:20:07 pm »

JRService.exe is JRiver Media Center service.  So we do have a service process running, but our TV recording is not in it.  It would be a lot of re-design of MC TV in order to put TV recording into it.
Logged
Yaobing Deng, JRiver Media Center

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10851
  • Dogs of the world unite!
Re: Logging into Windows automatically
« Reply #15 on: March 15, 2024, 06:26:29 pm »

There's a policy setting that does exactly that:
https://winaero.com/configure-automatic-sign-in-and-lock-after-restart-in-windows-10/amp/

It can also be enabled by registry key.

Note that the desktop is never actually shown, but it does in fact login in the background.

Thank you!
Logged
Yaobing Deng, JRiver Media Center

abrise

  • Junior Woodchuck
  • **
  • Posts: 86
Re: Logging into Windows automatically
« Reply #16 on: March 16, 2024, 10:32:17 pm »

There's a policy setting that does exactly that:
https://winaero.com/configure-automatic-sign-in-and-lock-after-restart-in-windows-10/amp/

It can also be enabled by registry key.

Note that the desktop is never actually shown, but it does in fact login in the background.
That is really helpfull. Thanks a lot. It solves my problem not only for JRiver but also for other servers like Calibre or Wireguard. Before I had to remote login via RDP or Teamviewer and log off for confidentiality reasons each time my PC was restarted while unattended .
Logged

David Sydney

  • Galactic Citizen
  • ****
  • Posts: 348
Re: Logging into Windows automatically
« Reply #17 on: March 18, 2024, 07:24:12 am »

I run Windows 10, & 11 under Linux KVM as virtual machines and one Windows machines auto starts and logs in ready to use when the host starts, with no prompt once the password is stored in the password list (PWL) file. this is a Windows function, it does not require running scripts or command lines batch files. Although does require a one off setup. This is for local accounts not Windows online accounts. This is a it different than using policy editor. Shows that there is usually 2 or 3 ways to do anything in Windows. Although they keep messing with the UI, most of the dialogs, applets from XP days are still there lurking.

Since windows took the first step settings/control panel diaog UI away - you have to go to regedit to enable it by going to
1. HKLM\Software\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device\DevicePasswordLessBuildVersion then change the entry to dword = "0" not "2" which is default.
2. in start menu run the old control panel dilog by searching and running for "netplwiz" now that it can run due to registry change, and in the dialog untick "users must enter user and password to use this computer" checkbox, then windows will prompt for the account password and it stores it in the pwl password list file (a local encrypted file I believe.

Next time you restart it will auto log in using the stored local password, not waiting for a prompt. The only time I need to enter my Windows account password is if I am access via UDP file explorer or remote desktop accross the network.

Note also there is usually a BIOS setting that dictates if the computer restarts or stays off after power failure that you might have to play to get it how you want it to behave also.
Logged
Dave
------
Linux Manjaro 23 / Windows 10 Pro | i7 14700K Gigabyte Z790 UD AX | JRMark 10253 | Realtek Integrated HDAudio SPDIF | PC Sound - Yamaha TSS-15 5.1 DAC (will be sad when capacitors die!)| Real Sound - DLNA Network to Yamaha RX-V777 Receiver Living Room + Deck | DLNA to Paired Yamaha WiFi WX-010 MusicCast Speakers to Outside Areas

antenna

  • Galactic Citizen
  • ****
  • Posts: 410
Re: Logging into Windows automatically
« Reply #18 on: March 24, 2024, 10:54:39 pm »

OK, I am late to this conversation, but I offer the following...

I have a Windows 10 PC as my MC client in the entertainment center here.

For years (literally), when I power up that PC, it logs in to an account (I think it is "media" or something like that).

Once in that account I have MC configured upon startup to run Media Center.

That brings me into Theater view.

And all is happiness from that point going forward.

 
Unfortunately, if you now ask me how I got Windows 10 to auto-login, I could not tell you.  And yeah, as I now type that, I realize that I blew  disaster recovery step (a major one).

So now I am now reliant upon the Macrium Reflect for disk images in case I need to undo a change.  Majorly unfortunately, the great Macrium Reflect  no longer seems to have a free license for home use.  That's a shame.

Logged
=========
Vinyl: Shure V15VxMR, Shure VN5MR stylus, VPI Scout turntable
Shellac: Shure M91, Shure N75-3 stylus,  Dual 1218 turntable

Apt Holman preamp (updated), Benchmark Media ADC-1, Benchmark Media DAC-1, Carver TFM-45 power amp (updated), Original Acoustic Research AR-9 speakers (LF surrounds replaced), Sennheiser HD590 headphones
Pages: [1]   Go Up