dumb2champ Posted January 7, 2015 Share Posted January 7, 2015 How to convert following perl scripts to php.... my ( $ServiceSet, $Service ); eval { $ServiceSet = Win32::OLE->GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2")-> ExecQuery("SELECT * FROM Win32_Service WHERE State=\"Running\""); }; unless ($@) { print "\n"; foreach $Service (in $ServiceSet) { print $Service->{Name}, "\n"; if( $Service->{Description} ) { print " $Service->{Description}\n"; } else { print " <No description>\n"; } print " Process ID: ", $Service->{ProcessId}, "\n"; print " Start Mode: ", $Service->{StartMode}, "\n"; print "\n"; } } Above code shows running services from win32_service that i`m taken from http://msdn.microsoft.com/en-us/library/aa394418%28v=vs.85%29.aspx... Please help.. i want to display running services and display it in table form??? Thank You... Quote Link to comment https://forums.phpfreaks.com/topic/293720-convert-from-perl-to-php-for-wmi-win32_service/ Share on other sites More sharing options...
Solution dumb2champ Posted January 7, 2015 Author Solution Share Posted January 7, 2015 sorry...nevermind...issues solve.. Quote Link to comment https://forums.phpfreaks.com/topic/293720-convert-from-perl-to-php-for-wmi-win32_service/#findComment-1501972 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.