Solved

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

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

728 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