Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Couldn't find the DismAPI library on Windows ADK...
- bool DismGetFeatureInfo(std::string passedFeature) //Microsoft-Windows-Subsystem-Linux
- {
- bool enabled = false;
- std::string status, command;
- command = " /C dism /online /get-featureinfo /featurename: | findstr /R /C:\"State\" > featureStatus.txt";
- command.insert(47,passedFeature);
- ShellExecuteW(NULL, L"open", L"cmd.exe", stringToLPWSTR(command), NULL, SW_HIDE);
- std::ifstream file("featureStatus.txt");
- getline(file, status, '\n');
- if(status.find("Enabled") != std::string::npos)
- {
- enabled = true;
- }
- file.close();
- remove("featureStatus.txt");
- return enabled;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement