foxidrive | 1 Apr 2006 10:38

Re: Re: Find specific string case

On Sat, 01 Apr 2006 08:30:25 -0000, gfunk99999 wrote:

> --- In batchworld@..., foxidrive <ffs <at> ...> wrote:
>>
>> On Sat, 01 Apr 2006 07:50:10 -0000, gfunk99999 wrote:
>> 
>>> The reg key values change depending on the power scheme 
> settings, so 
>>> I need to indetify this string 
>>> 0100000000000080000000000100000000000080 inside the reg key.  
> When 
>>> this string is present Stan by is disabled.
>>> 
>> 
>>   <at> echo off
>>  FOR /F "tokens=2* delims=	 " %%A IN ('
>>  REG QUERY "hku\S-1-5-21-661085450-4072288225-2494426723-500
> \Control Panel\PowerCfg\GlobalPowerPolicy" /v policies'
>>  ) DO ( 
>>  if "%%B"=="0100000000000080000000000100000000000080" (
>>  echo.
>>  echo Stand by Disabled
>>  echo.
>>  ) else (
>>  echo.
>>  echo Stand by Enabled
>>  echo.
>>  )
>>  )
>> 
>> 
>> But my PC doesn't have that key.
>> 
>> -- 
>> Regards,
>> Mic
>>
> 
> The problem is that that this set of
> numbers "0100000000000080000000000100000000000080" live inside this
> whole set
> 010000000200000003000000000000000200000003000000000000000200000003000
> 000000000000200000003000000000000000000000001000000000000800000000001
> 00000000000080010000000800000002000000040000C001000000040000000100000
> 00A000000000000000300000001000100010000000000000000000000000000000000
> 000000000200000000000000000000000000000000000000000000000300000000001
> 6000000 that's why I  first query the key, exported it to a text
> file, then do a findstr for
> just "0100000000000080000000000100000000000080" and pass it back in
> as a variable.  Then I tested for equality.  Does this make sense?

Yes. it does.

  <at> echo off
 FOR /F "tokens=2* delims=	 " %%A IN (
 'REG QUERY "hku\S-1-5-21-661085450-4072288225-2494426723-500\Control
Panel\PowerCfg\GlobalPowerPolicy" /v policies'
 ) DO >"c:\file.txt" echo/%%B 
  find "0100000000000080000000000100000000000080"< "c:\file.txt">nul
  if "%errorlevel%"=="0" (
  echo.
  echo Stand by Disabled
  echo.
  ) else (
  echo.
  echo Stand by Enabled
  echo.
  )
  del "c:\file.txt"

--

-- 
Regards,
Mic

To Post a message, send it to:   batchworld@...

To Unsubscribe, send a blank message to:
batchworld-unsubscribe@... 

Gmane