luxAeterna has asked for the wisdom of the Perl Monks concerning the following question:
Oh, Wise Ones
I find myself for the first time developing Perl for Windows servers. It is an hostile, unknown jungle for me.
My question is quite philosophical and I know that there is always more than way to do it, but what would you recommend as a safe way to run a Windows batch?
A Windows batch will unmercifully exit if it fails, generally providing through console really generic message about the cause of the fail, that rarely will point to the real issue, but it is better than nothing.
I deduce that for my script to continue running, at least to inform that there was an error before dying, I must spawn a child to execute the batch.
Problem: I understand that a Windows batch does not provide an error code return, and since it simply dies at any failure, executing inside an eval is futile.
Which are the plus and minuses of executing a Windows batch with system or with exec?
Say I have a batch to set the environment variables (which in fact, I have: \dir00\exploit\script\dir_start.cmd) and it can not find some path in certain machines
Thank you in advance to the monks who wish to dedicate some time to provide their experience to give some light in the obscure Windows land
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Best ways to run a windows batch with Perl
by BrowserUk (Patriarch) on Nov 28, 2014 at 11:21 UTC | |
|
Re: Best ways to run a windows batch with Perl
by Corion (Patriarch) on Nov 28, 2014 at 11:49 UTC | |
|
Re: Best ways to run a windows batch with Perl
by Anonymous Monk on Nov 28, 2014 at 11:14 UTC | |
by luxAeterna (Acolyte) on Nov 28, 2014 at 11:36 UTC | |
by Anonymous Monk on Nov 28, 2014 at 11:54 UTC |