{"id":13595232,"url":"https://github.com/murrayju/CreateProcessAsUser","last_synced_at":"2025-04-09T10:33:12.779Z","repository":{"id":17223163,"uuid":"19992012","full_name":"murrayju/CreateProcessAsUser","owner":"murrayju","description":"Creates a process in a different Windows session","archived":false,"fork":false,"pushed_at":"2024-02-10T16:54:54.000Z","size":40,"stargazers_count":378,"open_issues_count":16,"forks_count":119,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-04-05T03:12:31.862Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/murrayju.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-05-20T18:15:07.000Z","updated_at":"2025-03-31T18:01:05.000Z","dependencies_parsed_at":"2024-02-16T03:43:45.462Z","dependency_job_id":null,"html_url":"https://github.com/murrayju/CreateProcessAsUser","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murrayju%2FCreateProcessAsUser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murrayju%2FCreateProcessAsUser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murrayju%2FCreateProcessAsUser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murrayju%2FCreateProcessAsUser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/murrayju","download_url":"https://codeload.github.com/murrayju/CreateProcessAsUser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248020593,"owners_count":21034459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T16:01:46.105Z","updated_at":"2025-04-09T10:33:07.761Z","avatar_url":"https://github.com/murrayju.png","language":"C#","funding_links":[],"categories":["C#","C\\#","C# #"],"sub_categories":[],"readme":"# CreateProcessAsUser\n\n![Maintainers Wanted](https://img.shields.io/badge/maintainers-wanted-brightgreen.svg)\n\n---\n\n### 🚧 Looking for maintainers 🚧\n\u003e :loudspeaker: **We are actively seeking collaborators to help maintain and improve this project!**\n\nThis library was created 10+ years ago when I was actively working on Windows services. I have since moved on to other things, and I'm not in a position to easily maintain this project, which is still actively used by the community. If you are interested in helping, please reach out!\n\n---\n\nThis uses the Win32 apis to:\n\n1. Find the currently active user session\n2. Spawn a new process in that session\n\nThis allows a process running in a different session (such as a windows service) to start a process with a graphical user interface that the user must see.\n\nNote that the process must have the appropriate (admin) privileges for this to work correctly. For [WTSQueryUserToken](https://github.com/murrayju/CreateProcessAsUser/blob/0381db2e8fb36f48794c073e87f773f7ca1ae039/ProcessExtensions/ProcessExtensions.cs#L197) you will need the __SE_TCB_NAME__ privilege, which is typically only held by Services running under the LocalSystem account ( [SO Link](https://stackoverflow.com/a/1289126/1872399) ).\n\n## Usage\n```C#\nusing murrayju.ProcessExtensions;\n// ...\nProcessExtensions.StartProcessAsCurrentUser(\"calc.exe\");\n```\n\n### Parameters\nThe second argument is used to pass the command line arguments as a string. Depending on the target application, `argv[0]` might be expected to be the executable name, or it might be the first parameter. See [this stack overflow answer](https://stackoverflow.com/a/14001282) for details. When in doubt, try it both ways.\n\n## Demo Projects\nThe `DemoService` project uses .NET Framework 4.8. Building the demo will copy the batch files to the build target. \n\nSimilarly, the `DemoModernService` project uses .NET 8.0, and a build will copy the batch files to the build target. \n\nFor either version, CD to the bin directory and run `createService` to install and start the service. It will launch `calc.exe` as soon as it starts. After that, run `deleteService` to stop and uninstall the service.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurrayju%2FCreateProcessAsUser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmurrayju%2FCreateProcessAsUser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurrayju%2FCreateProcessAsUser/lists"}