Sumit Kumawat

Sumit Kumawat

  • NA
  • 454
  • 415.8k

Win32_ScheduledJob is not returning any result in c#

Nov 11 2017 4:11 AM
hi all i am using below code to fetch the All Task Schedule in window 7
 
ManagementScope scope = new ManagementScope("\\\\.\\ROOT\\cimv2");
string query = "SELECT * FROM Win32_ScheduledJob";
ManagementObjectSearcher searchCom;
ManagementObjectCollection moCollection;
WqlObjectQuery result = new WqlObjectQuery(query);
searchCom = new ManagementObjectSearcher(scope,result);
moCollection = searchCom.Get();
but it is not returing any result.
can anyone tell me what is wrong in above code?
 
TIA 
 

Answers (1)