Skip to content

Instantly share code, notes, and snippets.

@IISResetMe
Created April 2, 2019 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IISResetMe/100f9778ce88bc827df777a469c0f28d to your computer and use it in GitHub Desktop.
Save IISResetMe/100f9778ce88bc827df777a469c0f28d to your computer and use it in GitHub Desktop.
Add-Type '
using System;
using System.Runtime.InteropServices;
public class advapi32 {
[DllImport("advapi32.dll", SetLastError=true, CharSet=CharSet.Auto)]
public static extern IntPtr CreateService(
IntPtr hSCManager,
string lpServiceName,
string lpDisplayName,
uint dwDesiredAccess,
uint dwServiceType,
uint dwStartType,
uint dwErrorControl,
string lpBinaryPathName,
string lpLoadOrderGroup,
string lpdwTagId,
string lpDependencies,
string lpServiceStartName,
string lpPassword);
}
'
# class [advapi32]::CreateService() here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment