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... 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...
dumb2champ Posted January 7, 2015 Author Share Posted January 7, 2015 sorry...nevermind...issues solve.. 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
Archived
This topic is now archived and is closed to further replies.