Skip to content

Commit

Permalink
Closes #20
Browse files Browse the repository at this point in the history
Added more detailed error message to indicate to the Super Grate user that a repair needs to be done on the target PC.
  • Loading branch information
krisdb2009 committed Nov 15, 2019
1 parent edf43c5 commit 765dce1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions SuperGrate/Classes/Remote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ public static Task<bool> StartProcess(string Target, string CLI, string CurrentD
mClass.InvokeMethod("Create", new object[] { CLI, CurrentDirectory, startup });
return true;
}
catch(ManagementException e)
{
if(e.ErrorCode == ManagementStatus.InvalidNamespace)
{
Logger.Exception(e, "It appears that the target computer (" + Target + ") has a corrupt WMI installation. Run the command \"winmgmt.exe /resetrepository\" on the target PC to resolve this issue. https://docs.microsoft.com/en-us/windows/win32/wmisdk/winmgmt");
}
else
{
Logger.Exception(e, "Failed to run a command on " + Target + ".");
}
return false;
}
catch (Exception e)
{
Logger.Exception(e, "Failed to run a command on " + Target + ".");
Expand Down

0 comments on commit 765dce1

Please sign in to comment.