Skip to content

Commit

Permalink
+ FIX: error set service name
Browse files Browse the repository at this point in the history
  • Loading branch information
c3rebro committed Nov 20, 2017
1 parent cecf0e2 commit 1febfb6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,14 @@ public void readSettings()
Environment.Exit(0);
}
}
sddl=RunProcess(string.Format("sc"),string.Format("sdshow svcommnodesvr"),true, false);
sddl=RunProcess(string.Format("sc"),string.Format("sdshow {0}",selectedService.ToLower()),true, false);
Trace.WriteLine(sddl);
sddl=sddl.Replace("\r\n","");
Trace.WriteLine(sddl);

if(!sddl.Contains(string.Format("(A;;RPWPCR;;;{0})",userSID))) {
sddl=sddl.Insert(sddl.IndexOf("S:(AU"),string.Format("(A;;RPWPCR;;;{0})",userSID));
sddl=RunProcess(string.Format("sc"),string.Format("sdset svcommnodesvr \"{0}\"",sddl),true,false);
sddl=RunProcess(string.Format("sc"),string.Format("sdset {0} \"{1}\"",selectedService.ToLower(),sddl),true,false);

if(sddl.Contains("ERFOLG")){
MessageBox.Show(string.Format("Die Rechte wurden erfolgreich gesetzt\n\n{0}",sddl),"Erfolgreich",
Expand All @@ -239,7 +239,7 @@ public void readSettings()

sddlu=sddl;
sddlu=sddlu.Replace(string.Format("(A;;RPWPCR;;;{0})",userSID),"");
sddlu=RunProcess(string.Format("sc"),string.Format("sdset svcommnodesvr \"{0}\"",sddlu),true,false);
sddlu=RunProcess(string.Format("sc"),string.Format("sdset {0} \"{1}\"",selectedService.ToLower(),sddlu),true,false);

if(sddlu.Contains("ERFOLG")){
MessageBox.Show("Die Rechte wurden erfolgreich entzogen","Erfolgreich",
Expand Down

0 comments on commit 1febfb6

Please sign in to comment.