fafalone / RunAsTrustedInstaller

Run a program as TrustedInstaller (SYSTEM)
MIT License
93 stars 11 forks source link

CLI Version #1

Open g-pane opened 1 year ago

g-pane commented 1 year ago

Hi, Is possible to have a commandline version (x64 and x86) without interface? Thanks

fafalone commented 1 year ago

This should already be working with the current version. If you run it from the command line, specifying a program as an argument, e.g.

RunAsTI64.exe "C:\My Folder\MyProgram.exe"

It should just run the program as TI without showing the GUI.

If this isn't working for you, let me know.

g-pane commented 1 year ago

It work, but you can't add and argument to the MyProgram.exe

fafalone commented 1 year ago

Arguments shouldn't work any differently... all it's doing is calling the LaunchAsTI function with the command line text instead of the TextBox text; can you confirm the arguments work as expected from the GUI?

It uses the built in system APIs for parsing the command line, which sometimes are less than intuitive... if the path to your program has spaces in it, the path must be in quotes with the arguments outside the quotes...

RunAsTI64.exe "C:\My Folder\MyProgram.exe" -arg1 -arg2