Script runs when PC is locked, but not when logged out.

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
wellman
Newbie
Posts: 2
Joined: Wed Apr 03, 2013 4:46 pm

Script runs when PC is locked, but not when logged out.

Post by wellman » Wed Apr 03, 2013 4:53 pm

I recorded a macro that runs a report that I need to run at night when no one is at the PC. It runs fine while logged in. If I lock the PC, it unlocks it and runs fine. When I actually log out, it doesn't log in. I made sure that the "Enable AutoLogon when Windows is logged out" box is checked. This is a Win7 Pro PC on a domain. One thing that may be throwing it off, is that there is a legal disclaimer that you have to hit enter or click on before logging in. I don't know if that is what is causing the problem or not. I tried hitting enter manually and having the screen sitting with the dialog box waiting for the password, but that didn't help. Is this possible the problem, and is there a way for the program to handle the legal notice?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Apr 03, 2013 6:03 pm

Yes, that is most likely the problem. You will need to ask your domain administrator to remove the "LegalNotice" security policy.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
CyberCitizen
Automation Wizard
Posts: 724
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Thu Apr 04, 2013 2:29 am

I have this saved as a VBS file & have a scheduled task that runs it every hour to ensure that the disclaimer isn't there.

You need admin rights though as its a Machine Key.

Code: Select all

Set WshShell = WScript.CreateObject("WScript.Shell")
wshshell.Regwrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\legalnoticecaption","","REG_SZ"
wshshell.Regwrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\legalnoticetext","","REG_SZ"
FIREFIGHTER

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Apr 04, 2013 4:12 pm

That might not help if the policy is applied on reboot. I have seen a number of networks set that way, so that the policy is reapplied on restart BEFORE login. Therefore it will reappear even if those reg keys are removed. If so the only way forward is to ask the network/system admins to remove the PC from the policy.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
CyberCitizen
Automation Wizard
Posts: 724
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Mon Apr 08, 2013 1:25 am

I Have Been Using It That Way Without An Issue, As Policy Downloads On 1 Reboot & Applies On The Other Normally (Depends How It Is Configured).

But Yes That Has Worked For Me In The Past As Normally I Couldn't Get The Required Approval To Remove It, And That Message Stops Windows AutoLogon From Working Until The Ok Is Pressed. That Prevented Me From Executing My SSH Reverse Connection Allowing Remote RDP Access.
FIREFIGHTER

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts