.reg file that does not need confirmation to run


  1. Posts : 5
    New York
       #1

    .reg file that does not need confirmation to run


    My work computer turns on every morning at 3:00 to get updates. IF there are updates then the registry is rewritten and my auto login is gone. It takes a good 10-15 minutes to login so I have this .reg script to make my computer auto login

    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
    "AutoAdminLogon"="1"
    "DefaultUserName"="myname"
    "DefaultPassword"="mypass"
    "DefaultDomainName"="Domain"

    When it runs I get two popups:
    Adding info can unintentionally change or delete values....do you trust this file. [yes] [no]
    after I click yes I get
    The keys and values have been successfully added.

    is there a way to run a .reg file with no popups. I want to go to gpedit.msc"\windows settings\scripts\startup" and shutdown and add my script, but the popups make the shutdown process freeze. And when I tried startup, nothing happened. It didn't freeze or do anything. How can I cleanly run this file?
      My Computer


  2. Posts : 7,107
    W7 home premium 32bit/W7HP 64bit/w10 tp insider ring
       #2

    regedit


    Hi Joshua,
    Regarding the yes/no prompt, it can be done in 2 different ways
    Lower UAC setting to Never, or creating a Task with the following, see screenshot, roy = User (Joshua?)

    removing the Message promp requires the /s, (silent) added to the task

    Roy
    Attached Thumbnails Attached Thumbnails .reg file that does not need confirmation to run-skipuac.png  
      My Computer


  3. Posts : 5
    New York
    Thread Starter
       #3

    Thanks, but over my head.


    I went to lower the UAC and it was already on "never", then I went to add /s and wherever I added it, no change. Attached you'll see a picture of my scripts. I'm sure you'll see the error right away, I'm trying to learn my batch and VBS scripting. I want to load "auto_login" then shutdown, while giving myself a way out if I need to work longer.

    Thanks a million.
    Attached Thumbnails Attached Thumbnails .reg file that does not need confirmation to run-regedit.jpg  
      My Computer


  4. Posts : 7,107
    W7 home premium 32bit/W7HP 64bit/w10 tp insider ring
       #4

    have a look


    Hi Joshua,
    Have a look at this thread.

    https://www.google.co.uk/url?sa=t&rc...ciLgI9uWp1uv3A


    Roy
      My Computer


  5. Posts : 5
    New York
    Thread Starter
       #5

    Almost


    Thank you, I thought I had it, but when I would go to cmd and type
    powershell =file "C\path\to\script.reg" -noexit
    I got an error
    Processing -File...failed because the file does not have a '.psi' extension.

    Is there a way to do that with a .reg or .bat extension?
      My Computer


  6. Posts : 10,485
    W7 Pro SP1 64bit
       #6

    JoshuaLawrenc said:
    My work computer turns on every morning at 3:00 to get updates. IF there are updates then the registry is rewritten and my auto login is gone. It takes a good 10-15 minutes to login....
    Since this is your work computer, we need to be careful not to help you make changes that go against what your IT department wants.

    The removal of the auto logon settings in the registry is not done by Windows updates - so it must be done by group policy updates and/or scripts setup by your IT department. It seems obvious that the IT staff does not want this computer to automatically log a user on.

    Have you asked IT support why the computer takes 10-15 minutes after logon before it is of use to you?


    JoshuaLawrenc said:
    I went to lower the UAC and it was already on "never",
    That is really scary. That breaks so many things in the Windows security model.
      My Computer


  7. Posts : 5
    New York
    Thread Starter
       #7

    I am on the IT staff


    Yes I have made the registry adjustments myself. The auto login is OK because we also have a scheduled task to lock the computer directly after login. Then everything will be loaded but secure behind my password.
      My Computer


  8. Posts : 10,485
    W7 Pro SP1 64bit
       #8

    JoshuaLawrenc said:
    ...IF there are updates then the registry is rewritten and my auto login is gone...
    What software/script is removing the auto logon settings?
      My Computer


  9. Posts : 5
    New York
    Thread Starter
       #9

    Regedit


    I opened regedit, went to
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
    then set the values of DefaultUserName DefaultPassword and set AutoAdminLogin to 1
      My Computer


  10. Posts : 10,485
    W7 Pro SP1 64bit
       #10

    In your original post, you state:
    "IF there are updates then the registry is rewritten and my auto login is gone."

    I mentioned:
    "The removal of the auto logon settings in the registry is not done by Windows updates - so it must be done by group policy updates and/or scripts setup by your IT department."

    After which you stated:
    "I have made the registry adjustments myself."
    I know that. I'm talking about how your settings are getting removed.

    So I directly asked:
    "What software/script is removing the auto logon settings?"

    And again you mentioned your actions:
    "I opened regedit, went to"
    Again, you are telling me how you added the settings...
    ...I'm talking about how your settings are getting removed.


    I guess I'm not being clear. I know what settings you are changing. I know how you are changing those settings. I know why you are changing them. I know that you want to automate the changes to those settings. Rather than spend your time making those changes after updates*, I was suggesting that you stop the updates* from undoing your auto logon settings.

    *we are still not sure what updates you are talking about. I'm guessing group policy updates.



    To state things another way:
    1) the computer wakes at 3am
    2) if updates are applied, the auto logon settings are removed
    3) you desire to automatically re-enter the auto logon settings
    (user prompts are a problem)

    You made this thread because you ran into user prompt problems with step #3. I'm suggesting that you spend your time preventing step #2 from undoing your auto logon settings. Someone in your company should know what script is removing those auto logon settings on this computer.

    Group policies can be used to tell a computer to run a particular set of scripts at logon or at other times. Which policies to apply and which scripts to run for a given computer are often controlled by Active Directory (AD) Organizational Units (OU). If you went through the proper channels at your company, then this computer might be moved to an OU that does not force the removal of the auto logon settings.

    There is also an AD computer property setting called "Member of". A computer can be made a member of an exception group. The scripts that removes auto logon settings can be written in such a way as to check the "Member of" list and skip the removal of the auto logon settings... if the computer is authorized to auto logon.


    There are ways to automatically add the auto logon settings without getting user prompts... but helping you to do that would be creating one script to fight another script. It is just not the best thing to do. Since you are in IT, your manager should know who to contact about preventing the auto logon settings from being removed.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 06:36.
Find Us