title: Batch file to read ini
body: <p>I am trying to automate editing the <code>boot.ini</code> depending on the partition XP loads from.
  This is a snippet of the batch I am working on.  One minute it works and the next it fails.
  It doesn't always correctly read from the <code>boot.ini</code>    Any suggestions ?</p>
  
  <pre><code>@echo off
  find "multi(0)disk(0)rdisk(0)partition(1)\WINDOWS" boot.ini | sort /r | date | find "=" &gt; en#er.bat
  echo set value=%%5&gt; enter.bat
  call en#er.bat
  del en?er.bat &gt; nul
  echo Value is %value%
  
  
  if "%value%" NEQ "multi(0)disk(0)rdisk(0)partition(1)\WINDOWS" goto try2
  if "%value%"=="multi(0)disk(0)rdisk(0)partition(1)\WINDOWS" echo multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="- EMERGENCY SPYWARE SCAN MODE" /SAFEBOOT:NETWORK /SOS /BOOTLOG /NOGUIBOOT &gt;&gt;boot.ini
  goto NEXT
  
  :try2
  find "multi(0)disk(0)rdisk(0)partition(2)\WINDOWS" boot.ini | sort /r | date | find "=" &gt; en#er.bat
  echo set value=%%5&gt; enter.bat
  call en#er.bat
  del en?er.bat &gt; nul
  echo Value is %value%
  
  
  if "%value%" NEQ "multi(0)disk(0)rdisk(0)partition(2)\WINDOWS" goto try3
  if "%value%"=="multi(0)disk(0)rdisk(0)partition(2)\WINDOWS" echo multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="- EMERGENCY SPYWARE SCAN MODE" /SAFEBOOT:NETWORK /SOS /BOOTLOG /NOGUIBOOT &gt;&gt;boot.ini
  goto Next
  
  :try3
  find "multi(0)disk(0)rdisk(0)partition(3)\WINDOWS" boot.ini | sort /r | date | find "=" &gt; en#er.bat
  echo set value=%%5&gt; enter.bat
  call en#er.bat
  del en?er.bat &gt; nul
  echo Value is %value%
  
  if "%value%"=="multi(0)disk(0)rdisk(0)partition(3)\WINDOWS" echo echo multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="ECLIPSE COMPUTERS - EMERGENCY SPYWARE SCAN MODE" /SAFEBOOT:NETWORK /SOS /BOOTLOG /NOGUIBOOT &gt;&gt;boot.ini
  if "%value%" NEQ "multi(0)disk(0)rdisk(0)partition(3)\WINDOWS" ECHO Please Edit Boot.ini Manually !!!!!
  pause
  ECHO multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="- EMERGENCY SPYWARE SCAN MODE" /SAFEBOOT:NETWORK /SOS 
  
  /BOOTLOG /NOGUIBOOT &gt;&gt;boot.ini
  notepad.exe boot.ini
  
  :NEXT
  
  echo This is me being happy...boot.ini
  </code></pre>