Re: Simple batch files for integrating updates and drivers in Win7
What is the environment the batch is run in? Why not just use %systemdrive% or %windir% or %systemroot% and skip the whole drive-scan? %systemdrive% will return the drive letter (K:\) of the OS you're running in and the others will return "K:\Windows".
Thanks mr_smartepants. I added a card reader and the it added new drive letters to my computer. Since the drive letters are empty, they returned a "No Disk' error which is now fixed with this
@echo off For %%I in (C D E F G H I J K L M N O P Q R S T U V W X Y Z A B) do (dir %%I:\ 1>nul 2>nul && if /i exist %%I:\Windows set Pagefile=%%I:&goto ok) goto notfound :ok SetPageFile.exe %pagefile%\pagefile.sys 1024 goto end :notfound echo pagefile not found :end
Oh by the way, the reason I do a scan is because I use MiniXP allot and sometimes the systemdrive I need to scan is E or D and I have seen F one time. The driver letters on MiniXP never match the drive letters on my computer
Last edited by laddanator (2011-11-15 01:20:00)