BAT file to search for a VALUE in registry
Hi All,
I've written a batch file to search the registry key HKLM\Software\Oracle and all its subkeys for the string value 'NLS_LANG'.If present change its value to abc. My script works for Windows 7, Windows Vista, but says too many commandline for Windows XP.
Can someone pls help.
Set var1=abc
Set var2=DD-MON-YYYY
for /f "tokens=*" %%a in ('reg query HKLM\SOFTWARE\ORACLE /v "NLS_LANG" /s ^| find /i "\ORACLE"') do (
echo %%a
REG ADD "%%a" /v NLS_LANG /t REG_SZ /f /d %var1%
)
Thanks
I've written a batch file to search the registry key HKLM\Software\Oracle and all its subkeys for the string value 'NLS_LANG'.If present change its value to abc. My script works for Windows 7, Windows Vista, but says too many commandline for Windows XP.
Can someone pls help.
Set var1=abc
Set var2=DD-MON-YYYY
for /f "tokens=*" %%a in ('reg query HKLM\SOFTWARE\ORACLE /v "NLS_LANG" /s ^| find /i "\ORACLE"') do (
echo %%a
REG ADD "%%a" /v NLS_LANG /t REG_SZ /f /d %var1%
)
Thanks
0 Comments
[ + ] Show comments
Answers (5)
Please log in to answer
Posted by:
anonymous_9363
14 years ago
Posted by:
mdallen
14 years ago
Posted by:
nprat
14 years ago
Thanks for your reply.
I tried VBScript too. My VBscript checks for the value 'NLS_LANG' in HKLM\SOFTWARE\ORACLE and all its Subkeys but not their subkeys.
Can any one please help me with the VBScript or Bat file to check for the value NLS_LANG in HKLM\SOFTWARE\ORACLE and all its subkeys and their subkeys and change its value to ABC.
I tried VBScript too. My VBscript checks for the value 'NLS_LANG' in HKLM\SOFTWARE\ORACLE and all its Subkeys but not their subkeys.
Can any one please help me with the VBScript or Bat file to check for the value NLS_LANG in HKLM\SOFTWARE\ORACLE and all its subkeys and their subkeys and change its value to ABC.
Posted by:
nprat
14 years ago
Posted by:
anonymous_9363
14 years ago
Go to jsware.net and find the class pack. In there, you'll find a registry class, which you can include/attach to any of your scripts to give a (relatively) neat way to access the registry and most of its data types (the Shell registry methods don't include some of the common data types...).
Don't be put off by the word "class": it's easy to use and contains example code. The reason I mention it is that it includes a function to enumerate all sub-keys and another to enumerate the values and data in a key. The entries get put into an array, which you can then loop through, searching for your string.
Don't be put off by the word "class": it's easy to use and contains example code. The reason I mention it is that it includes a function to enumerate all sub-keys and another to enumerate the values and data in a key. The entries get put into an array, which you can then loop through, searching for your string.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.