How do I get a value from the windows registry to set a variable 2005-10-12 - By Dimitar Radoulov
Works on my PC, may be with copy/paste the delims are changing, try to adjust the value to TAB followed by a space. Regards, Dimitre
On 10/11/05, Juan Carlos Reyes Pacheco <juancarlosreyesp@(protected)> wrote: > > Thanks a lot Dimitre, copying and pasting directly from the email > don't work precisely, but the solution is there :) > On 10/11/05, Radoulov, Dimitre <cichomitiko@(protected)> wrote: > > Excuse me, the correct syntax is with tokens=3*(by using the asterisk we > > make sure that not only the third word is used but everything following > it > > as well) and you have to set %%A (not %%B). > > > > > > @(protected) OFF > > :: delims is a TAB followed by a space > > FOR /F "tokens=3* delims= " %%A IN ('reg query HKLM\SOFTWARE\ORACLE\ /v > > ORACLE_HOME') DO SET > > CURR_OH=%%A > > ECHO Oracle home is %CURR_OH% > > > > > > > > > > Dimitre Radoulov > > > > > > > -- > Oracle Certified Profesional 9i 10g > Orace Certified Professional Developer 6i > > 8 years of experience in Oracle 7,8i,9i,10g and developer 6i >
<div>Works on my PC, may be with copy/paste the delims are changing, try to adjust the value to TAB followed by a space.</div> <div> </div> <div> </div> <div>Regards,</div> <div>Dimitre<br><br> </div> <div><span class="gmail_quote">On 10/11/05, <b class="gmail_sendername">Juan Carlos Reyes Pacheco</b> <<a href="mailto:juancarlosreyesp@(protected)" >juancarlosreyesp@(protected)</a>> wrote:</span> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0 .8ex; BORDER-LEFT: #ccc 1px solid">Thanks a lot Dimitre, copying and pasting directly from the email<br>don't work precisely, but the solution is there :) <br>On 10/11/05, Radoulov, Dimitre <<a href="mailto:cichomitiko@(protected)" >cichomitiko@(protected)</a>> wrote:<br>> Excuse me, the correct syntax is with tokens=3*(by using the asterisk we<br>> make sure that not only the third word is used but everything following it <br>> as well) and you have to set %%A (not %%B).<br>><br>><br>> @(protected) OFF<br>> :: delims is a TAB followed by a space<br>> FOR /F " ;tokens=3* delims= " %%A IN ('reg query HKLM\SOFTWARE\ORACLE\ /v <br>> ORACLE_HOME') DO SET<br>> CURR_OH=%%A<br>> ECHO Oracle home is %CURR_OH%<br>><br>><br>><br>><br>> Dimitre Radoulov<br>><br> ><br><br><br>--<br>Oracle Certified Profesional 9i 10g<br>Orace Certified Professional Developer 6i <br><br>8 years of experience in Oracle 7,8i,9i,10g and developer 6i<br>< /blockquote></div><br>
|
|