Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-05-15
2
Medium Priority
?
2,064 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
[X]
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 Comments
 
LVL 7

Accepted Solution

by:
Hubasan earned 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

636 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