|
Hi list, I need some help identifying Win 2000 Pro installations in
my Perl script. Win 2000 Svr is not a problem. Here is what I am doing. MS has GetType.exe as part of the W2k Resource Kit. But when
run on 2000 Pro from Perl script (at least mine) I get an invalid response. I
have tried many combinations of script code with no joy. Here is one I think
should work but does not. snip my ($ExitCode); my $ReturnCode = Win32::Process::Create( my
$ProcObj, ‘GetType.exe’, ‘GetType
/s’, 0, NORMAL_PRIORITY_CLASS, ‘.’
); $ProcObj -> Wait(INFINITE); $ProcObj -> GetExitCode($ExitCode); print "Exit: $ExitCode and Return: $ReturnCode\n"; snip When run on 2000 Svr, this code produces 4, 1 as expected. When run on 2000 Pro, I get 4238624, 1 (wrong). I also tried other combinations using backticks, qx(), etc.
but nothing works for me and the complaints don’t seem to be as expected. Thought about writing output to a file as in qx( "gettype /s > c:\\temp\\OSType.txt" )
but this complains about both /s and > args. When run from command line or as DOS batch using
errorlevels, all is okay. What am I missing here? Failing this method, is there
another means to determine Win32 type? I used to parse a sysinfo report but
that was very slow. Here is a snippet from command line help for GetType.exe Usage: gettype [\\remotemachine] [/s] /s for Silent Mode Returns 1 for Windows NT Workstation. Returns 2 for Windows 2000 Professional installation. Returns 3 for Windows NT Server Non-Domain Controller. Returns 4 for Windows 2000 Server Non-Domain
Controller. Returns 5 for Windows NT Server Domain Controller. Thanks… Sturdy |
_______________________________________________ Perl-Win32-Users mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
