Hi all,
Trying to run Windows command and process return code, then use return codes to process code
In Win Command line:
c:\command
results here
c:\echo %errorlevel%
30 (for example)
In Perl, I try to run the following code
$output = `command`;
$errorlevel = `echo %errorlevel%`;
print $output; #just to view results
print $errorlevel; #just to review results
$errorlevel always returns 0 instead of 30, because I think it is started in a different shell to the `command` system call.
How do I tie the two commands together so that I get the same result as running it from the command line?
Thanks
Steve
Trying to run Windows command and process return code, then use return codes to process code
In Win Command line:
c:\command
results here
c:\echo %errorlevel%
30 (for example)
In Perl, I try to run the following code
$output = `command`;
$errorlevel = `echo %errorlevel%`;
print $output; #just to view results
print $errorlevel; #just to review results
$errorlevel always returns 0 instead of 30, because I think it is started in a different shell to the `command` system call.
How do I tie the two commands together so that I get the same result as running it from the command line?
Thanks
Steve