http://www.perlmonks.org?node_id=401177


in reply to Re: Win32 - Dependant services
in thread Win32 - Dependant services

Hi PJ,
Here is a possible solution using your command shell idea and the output from 'net stop'
use strict; my @order; my @results = `net stop mssqlserver /N`; foreach(@results){ if(/^ /){ push(@order,$_) } } foreach(reverse(@order)){ print("Stopping $_\n"); system("net stop \"$_\""); } #...... reverse to start again....

This is an initial hack. Any ideas for improvement are welcome!!
Bye!