Jump to content
Sign in to follow this  
Ambient

Batch File Problem

Recommended Posts

Hi Guys,

I have been messing about with a little script that accepts a parameter which is the name of a batch file (any batch file in C:\batch) which the script will then run showing a progress bar until cmd.exe closes. I haven't quite finished it but I was using a batch file which pings google for testing and I noticed the when my script finishes cmd.exe gets closed but ping.exe remains open in processes. My problem is how can i determine what processs get opened by the batch file? I was thinking of perhaps getting all running processes at the start of the script into an array the when I run the batch file doing the same then compareing to get the differnces. When I have the differences closing them when the script finishes. Just my thoughts but there is probably an easier way to do this. The reasn I want to do this is we use quite a few batch files historically and it would be nice notto have to re-write then but run them hidden rather then have them showing CMd windows all over the place.

Share this post


Link to post
Share on other sites

Hi Ambient,

take a look at the entry from SmOke_N He has a code snippet to get the child processes.

Anyway I'd suggest you to rewrite the batchs. :unsure:

E.g. for pinging you could simply use ping() in a loop.


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...