[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Logon Script to set registry key.

Posted on 2008-06-25
Medium Priority
Last Modified: 2008-11-11
Windows 2000 Domain
1500 Windows 2000 desktops

What I need to do is change the following registry keys on all PCs on the network. When i run the .reg file the correct settings are applied no problem so I know they are correct.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"LegalNoticeCaption"="XXXXXX Data Network"
"LegalNoticeText"="A criminal offence may be commited by accessing this computer or modifying any data in this computer without authorisation and persons doing so may be liable to prosecution"
"LogonPrompt"="XXXXXX authorised staff may enter a user name and password"

I have tried to create a .ADM file but it says there is an error in line 16. When i import other ADM files the atributes appear but have no settings underneath them.

To do this I used an app called ADM2REG.exe which converts .reg files into .ADM. I have now given up on this as i am aware that our AD is a bit sketchy some of the time and don't have any previous experience to know if this is correct behaviour or not. (Can't wait until we upgrade to 2003).
Here is the ADM file if anyone wants to comment. Fails to import on line 16 whic is the END POLICY line? Unfortunately I don't have a test domain just now so can't try to import it on another domain to see if it functions.
CATEGORY "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
  POLICY Winlogon
  KEYNAME "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
    PART LegalNoticeCaption EDITTEXT
    VALUENAME "LegalNoticeCaption"
    PART LegalNoticeText EDITTEXT
    VALUENAME "LegalNoticeText"
    PART LogonPrompt EDITTEXT
    VALUENAME "LogonPrompt"
    PART DontDisplayLastUserName EDITTEXT


I would now like to make these changes using the Startup script but am unsure of what syntax to add in. The security would be ok as it would run as system.
Have spent some time trying to find good articles but they all mention .ADM files or reg.ini.

My scripting is pretty limited hence I am asking here.

Thanks in advance for your help.
Question by:AWGMorrison
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 38

Expert Comment

ID: 21868534
Just place the .reg file in the script directory and use the command REGEDIT /S filename.reg.

Author Comment

ID: 21868580
I tried that and without the /S it asks the user to accept. I found the /S and it doesn't seem to work?

I assumed it was because the users don't have permission to modify the registry? Is that not correct. As I said before we do have some issues with AD here and there so wouldn't be a total shock if it wasn't working as expected.
LVL 38

Accepted Solution

Shift-3 earned 1600 total points
ID: 21869045
If you're using it in a startup script (under Computer Configuration\Windows Settings\Scripts\Startup) rather than a logon script then it should run under the computer's SYSTEM account.  By default this account has full control of HKEY_LOCAL_MACHINE, so permissions shouldn't be a problem.

Author Comment

ID: 21870486
What is the syntax for setting a regsitry key in the Startup script?

Apologies but I can't find a guide to this anywhere.

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
While there are many new features for iOS 11, these are the five that can improve your digital lifestyle.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question