Solved

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

Posted on 2009-05-15
2
1,957 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

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

830 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