(view source code of isdev.cmd as plain text)
@ECHO OFF
:: Checks if %1 is a valid OS/2 or NT device name
ECHO.
IF "%1"=="" GOTO Syntax
IF "%1"=="/?" GOTO Syntax
:: OS/2 or NT?
IF "%OS%"=="Windows_NT" GOTO NT
:OS2
:: Based on the fact that OS/2 devices are
:: always "located" in the "directory" \DEV
DIR %1 2>&1 | FIND "\\DEV" >NUL
IF ERRORLEVEL 1 ECHO.%1 is NOT a valid OS/2 device name
IF NOT ERRORLEVEL 1 ECHO.%1 is a valid OS/2 device name
GOTO End
:NT
:: Based on the fact that DIR doesn't show a volume label for devices
DIR %1 2>&1 | FIND /I "Volume" >NUL
IF ERRORLEVEL 1 (ECHO.%1 is a valid NT device name) ELSE (ECHO.%1 is NOT a valid NT device name)
GOTO End
:Syntax
ECHO IsDev.cmd, Version 2.00 for Windows NT/2000 and OS/2
ECHO Checks if the specified parameter is a valid device name
ECHO.
ECHO Usage: ISDEV ^<device_name^>
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com
:End
page last modified: 2024-04-16; loaded in 0.0057 seconds