In the following examples, the Pre-OS framework is used to detect and correct
differences in a critical file on the PC's hard drive.
TCP/IP or PXE Pre-OS Sample
CONFIG.SYS:
device=himem.sys /TESTMEM:OFF
device=emm386.exe noems
dos=high,umb
files=60
device=\net\ifshlp.sys
lastdrive=z
AUTOEXEC.BAT:
cd\net
net initialize
netbind.com
umb.com
tcptsr.exe
tinyrfc.exe
nmtsr.exe
emsbfr.exe
rem assumes username = "preos", password = "password", mapped drive = z:
net logon preos password /savepw:no /yes
rem Pre-OS agents are loaded here…
fc /b c:\windows\system.dat z:\critical\systems.dat > c:\temp\compare.txt
find /i "no difference encountered" c:\temp\compare.txt >nul
if errorlevel 2 echo Error in string search. Cannot report if matches found.
if errorlevel 1 goto CriticalFilesDifferent
if errorlevel 0 goto CriticalFilesNotDifferent
:CriticalFilesDifferent
echo Critical files have changed. Restoring files now…
copy z:\critical\system.dat c:\windows\system.dat /v /y
goto END
:CriticalFilesNotDifferent
echo Critical Files intact…proceeding to local disk boot…
:END
delete c:\temp\compare.txt
pboot
N
N
O
O
T
T
E
E
:
:
Access to drive z: in this example is based on mapping that
drive before image file creation. Drive mappings are stored
when using the MS Network Client for MS-DOS v3.0.
52