I need to write a script that runs a series of Windows commands, and I have to 
wait while each performs its functions, then go on to the next command.

I know almost nothing about Windows, and I can't test it because I don't have a 
Windows box. I read up a bit and it looks to me that something like this should 
work:


  system 'C:\Documents and Settings\bill>sc stop nexus-webapp';

  system 'C:\Documents and Settings\ bill >sc start nexus-webapp';

  system 'C:\Documents and Settings\ bill >sc query nexus-webapp';


Does that look right? Or do I need to do something more like this example:

 use POSIX ":sys_wait_h";

    do {
        system 'C:\Documents and Settings\bill>sc stop nexus-webapp';
        $kid = waitpid(-1, WNOHANG);
     } while $kid > 0;

(source: http://perldoc.perl.org/functions/waitpid.html)


Or am I not even close with either?

Thanks,

Bill
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to