Solved

Way to use a username wild card in .reg for a Login Script?

Posted on 2009-05-15
2
1,890 Views
Last Modified: 2012-08-13
I currently have a login script that calls a .reg file.  
"regedit /s filename.reg"

Below is the setup I have for the .reg file that gets called.  First key is same for everyone, Second key's path needs to change depending on username.

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\fake\path\blah]
"This Key is the same for all users"="C:\\Program Files\\fakeProgramLocation"
"This key is different for each user"="C:\\Documents and Settings\\%username%\\Desktop\\desitinationfolder\\"


Is there someway to use the wildcard like \%username%\  works in normal login scripts?
Is there a better way to do this?
0
Comment
Question by:mpmccann
2 Comments
 
LVL 7

Accepted Solution

by:
Hubasan earned 500 total points
ID: 24399428
better option than importing a reg file would be to use a REG command from a batch file.

open up your command prompt and type REG and press enter, and you will get all of the options that you can use. if you want to add a registry key, you would type REG ADD /? to see the help on reg add command...etc.
When you use REG command within a login script it will respect all environment variables including %USERNAME% variable so it should work for you.

Hope this helps.

Good Luck.
0
 

Author Comment

by:mpmccann
ID: 24399794
Works Great, thanks.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now