(view source code of getports.pl as plain text)
#! perl
if ( $ARGV[0] ) {
print "\nGetPorts.pl, Version 1.00 for DOS, Windows & OS/2\n",
"Display port addresses of parallel and serial ports\n\n",
"Usage: GETPORTS.PL\n\n",
"This script uses DEBUG.EXE to read the information from base memory.\n",
"Tested in Windows 2000 only.\n\n",
"Written by Rob van der Woude\n",
"http://www.robvanderwoude.com\n\n\n",
"Your ports info:\n";
}
print( "\n" );
## Create temporary DEBUG script
$dbg = "D 40:0 L E\nQ\n";
open( DBGSCR, "> getports.dbg" ) || die( "Cannot open temporary DEBUG script: $!" );
print DBGSCR $dbg;
close DBGSCR;
## Run DEBUG script and store output in array
@portsdbg = split( /([-,\s])/,`debug.exe < getports.dbg | find " "` );
## Format and display the result
for ( $c = 1; $c < 5; $c++ ) {
print( "COM$c=@portsdbg[4*$c+2]@portsdbg[4*$c]\n");
}
for ( $c = 1; $c < 4; $c++ ) {
print( "LPT$c=@portsdbg[4*($c+4)+2]@portsdbg[4*($c+4)]\n");
}
## Delete temporary DEBUG script
`DEL getports.dbg >NUL 2>&1`;
page last modified: 2024-04-16; loaded in 0.0077 seconds