forked from py7hagoras/GetSystem
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathProgram.cs
More file actions
28 lines (20 loc) · 747 Bytes
/
Program.cs
File metadata and controls
28 lines (20 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System.Diagnostics;
using System.ServiceProcess;
namespace GetTrustedInstaller
{
class Program
{
static void Main(string[] args)
{
// I use TrustedInstaller process that is in the background only when the TrustedInstaller service is running to pass its ID to py7hagoras code
ServiceController sc = new ServiceController
{
ServiceName = "TrustedInstaller",
};
if (sc.Status != ServiceControllerStatus.Running)
sc.Start();
Process[] proc = Process.GetProcessesByName("TrustedInstaller");
IamYourDaddy.Run(proc[0].Id, args[0]);
}
}
}