Recently written a program, it is written.
View all service information
Use Win32 :: Service;
Win32 :: Service :: GetServices ('', /% soldes);
Foreach $ key (Sort Keys% Services) {Print "Display Name / T: $ KEY, $ Services {$ Key} / n"; Win32 :: Service :: getStatus ('', $ services {$ key}, /% Status); Foreach $ part (keys% status) {print "/ t $ part: $ status {$ part} / n";}}
View a single service information Win32 :: service :: getStatus ('', 'w3svc', /% status); # 中 W3SVC is a service short name, you can view the Win2000 / XP Administration Tools service to find it. Foreach $ part (keys% status) {print "/ t $ part: $ status {$ part} / n";
Open service WIN32 :: Service :: StartService ('', 'w3svc') || DIE "can't start service / n";
Close Service Win32 :: Service :: StopService ('', 'w3svc') || DIE "can't stop service / n";