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
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
DOS command files are too painful...If it were me, I'd use a proper scripting language, e.g. VBScript or PowerShell. And before you ask, there are quadzillions of sample scripts out there to query/delete from/add to the registry.
Answered 03/16/2010 by: VBScab
Red Belt

Please log in to comment
0
The problem you are running into is that for the REG command in XP, /s and /v are mutually exclusive. You cannot issue both on the same command. I believe that /s will suffice for your instance, you will just be parsing more returned lines using the find command.
Answered 03/16/2010 by: mdallen
Senior Yellow Belt

Please log in to comment
0
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.
Answered 03/17/2010 by: nprat
Yellow Belt

Please log in to comment
0
VBScab Thanks for your reply. Can you please help me with the script as I am new to VBScripting.

I tried VBScript too. My VBscript checks for the value 'NLS_LANG' in HKLM\SOFTWARE\ORACLE and all its Subkeys but not their subkeys and beyond.

Pls help
Answered 03/17/2010 by: nprat
Yellow Belt

Please log in to comment
0
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.
Answered 03/18/2010 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity