Devicecleanup.exe 〈Recommended〉

else if (arg == L"/verbose") g_verbose = true;

// Get instance ID WCHAR instanceId[256]; if (CM_Get_Device_ID(devInst, instanceId, 256, 0) == CR_SUCCESS) std::wcout << L"Instance: " << instanceId << std::endl; DeviceCleanup.exe

int RemoveAllNonPresent() HDEVINFO hDevInfo = SetupDiGetClassDevs(NULL, NULL, NULL, DIGCF_ALLCLASSES); if (hDevInfo == INVALID_HANDLE_VALUE) std::wcerr << L"Failed to get device list.\n"; return 1; else if (arg == L"/verbose") g_verbose = true;

else if (arg == L"/remove") g_action = ACTION_REMOVE_ONE; if (i + 1 < argc) g_targetId = argv[++i]; // Get instance ID WCHAR instanceId[256]

std::wcerr << L" -> Failed to remove device. Error: " << cr << std::endl; return false;