@echo off
set Patch_Default_Path=Win7_x86

if exist %SystemRoot%\system32\takeown.exe goto Win7
:xp_x86
rem echo Windows XP

cd Xp_X86
setup
cd ..
goto exit

:Win7
rem echo Windows 7

takeown /f %SystemRoot%\system32\drivers\serial.sys
icacls %SystemRoot%\system32\drivers\serial.sys /grant administrators:F

if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set Patch_Default_Path=Win7_amd64
cd %Patch_Default_Path%
copy serial.sys %SystemRoot%\system32\drivers\serial.sys
cd ..
:exit
echo update successful.
@echo on 
