(view source code of chkfdisk.cmd as plain text)
@ECHO OFF
REM ChkFdisk.cmd, Version 2.00
REM Written by Rob van der Woude
REM Checks if OS/2 partition is active on bootup, and makes it active
REM and reboots if not. Also deletes "illegal" swap file on RPL server
REM For RPL servers only:
REM specify full path and name of swap file on RPL server
SET SWAPFILE=Z:\OS2\SYSTEM\SWAPPER.DAT
REM Otherwise:
REM SET SWAPFILE=
REM Check if OS/2 partition is active (C:)
FDISK /QUERY | FIND "C:" | FIND "OS/2" > NUL
REM If not, set it active
IF ERRORLEVEL 1 GOTO ChgAccess
REM If active, remove swap file from RPL server if necessary
IF NOT "%SWAPFILE%"=="" IF EXIST %SWAPFILE% DEL %SWAPFILE%
GOTO End
:ChgAccess
REM Toggle active partition
FDISK /SETACCESS
REM Check if it succeeded
FDISK /QUERY | FIND "C:" | FIND "OS/2" > NUL
REM If not, display error message
IF ERRORLEVEL 1 GOTO Error
REM Reboot if successfull
SETBOOT /IBD:C:
GOTO End
:Error
REM Error message
ECHO Error changing accessible partion:
FDISK /QUERY
PAUSE
:End
page last modified: 2023-03-10