processes for dummies

Posted on 2003-02-27
Medium Priority
Last Modified: 2010-03-05
I have a perl script running in a dos window (cygwin), and it goes a little like this:

1) Batch file calls perl script
2) Perl script does some stuff
3) Perl script calls shutdown.exe (shuts machine down)
---Insert Brainfart here
4) Perl script ends
5) Batch file ends
shutdown.exe does its thing sometime between when it was called and now. Its on a timer of x seconds.

The problem, of course, is that in Win98 the DOS window can't be forced to close because the batch has to finish. The batch can't finish because shutdown.exe hasn't "finished" until windows is shut down (duh)

So is there some way to split the process so that shutdown goes and starts its thing while in the meantime the perl script (and therefore the batch file) finish up?

Or whatever the solution...i just want the darn machine to shutdown after (or near the end) of the script. I had it working great in 2000/XP but then I tried it on 98 and I ran into this stubborn DOS window.


Will raise points depending on how helpful the answer is.  
Question by:smorehou

Accepted Solution

s_mack earned 80 total points
ID: 8032548
I could be missing the problem but if I were you I'd just get a better shutdown.exe if you aren't married to the one you are using.

I was curious so I downloaded a couple (there are hundreds) and one shutdown windows 98 just fine and the other got stuck as you described. I don't remember which one is which because they are both called shutdown.exe :) I did a search for "freeware shutdown" and found dozens.

Other than that, I'm sure there is a more complicated answer with exec() or fork() that someone will provide.

Author Comment

ID: 8032563
right on! I was using the one that came with cygwin. I never even thought about finding a different one. The first one I found does the trick perfectly and has tons of options that I can play with too.   Its shareware ($10) but it saves me headaches so I think it will be worth it. If not, I'm sure I can find another.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question