Tom2011
-
Total Posts
:
4
- Scores: 0
-
Reward points
:
330
- Joined: 7/13/2010
-
Status: offline
|
Query Registry Key and add to a system variable or Text file (Batch file)
Tuesday, July 13, 2010 12:18 PM
( permalink)
Hi all I'd like to query the Key / Value: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName and add the output to a System Variable (%VariableName%) Thx 4 hlp!
|
|
|
|
hiyatran
-
Total Posts
:
5
- Scores: 0
-
Reward points
:
2170
- Joined: 8/7/2010
- Location: Canada
-
Status: offline
|
Re:Query Registry Key and add to a system variable or Text file (Batch file)
Monday, August 09, 2010 1:34 PM
( permalink)
Can you modify the registry key using the batch file?
|
|
|
|
averbon
-
Total Posts
:
14
- Scores: 1
-
Reward points
:
12330
- Joined: 1/16/2002
- Location: Switzerland
-
Status: offline
|
Re:Query Registry Key and add to a system variable or Text file (Batch file)
Saturday, September 04, 2010 4:34 PM
( permalink)
Hi Tom2011, Here's an example: @ECHO OFF :: delims is a TAB followed by a space FOR /F "tokens=3 delims= " %%A IN ('REG QUERY "HKCU\Control Panel\International" /v sCountry') DO SET Country=%%A ECHO Country=%Country% SETX Country %Country% Also have a look at the SETX command itself, depending on what registry value you are looking for you can do it directly with SETX. SETX TZONE /K HKEY_LOCAL_MACHINE\System\CurrentControlSet\ Control\TimeZoneInformation\StandardName Hope this helps
|
|
|
|