?
Solved

processes for dummies

Posted on 2003-02-27
2
Medium Priority
?
149 Views
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.

Thanks.

Will raise points depending on how helpful the answer is.  
0
Comment
Question by:smorehou
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
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.
0
 

Author Comment

by:smorehou
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.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
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

752 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