Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Running Visio Macro from VBS File 3 58
regedit.exe REG ADD problems 2 36
Add and format columns in vb6 7 47
Check folder every for files and print them 5 23
Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

920 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

13 Experts available now in Live!

Get 1:1 Help Now