CreateProcessAsUser: Unhandled Exception

I couldn’t get this to work for me, I’m new to C# so maybe I’m doing something wrong, here’s the code

using System;
using murrayju.ProcessExtensions;

namespace spawnproc
{
    class Program
    {
        static void Main()
        {
            Console.WriteLine("Starting calc.exe");
            ProcessExtensions.StartProcessAsCurrentUser("calc.exe");
        }
    }
}

trying to run this will return the following error, with exit status code 255

Unhandled Exception: System.Exception: StartProcessAsCurrentUser: CreateProcessAsUser failed.

   at murrayju.ProcessExtensions.ProcessExtensions.StartProcessAsCurrentUser(String appPath, String cmdLine, String workDir, Boolean visible)
   at spawnproc.Program.Main()

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 1
  • Comments: 31 (10 by maintainers)

Most upvoted comments

Hi i also getting the following error: StartProcessAsCurrentUser: GetSessionUserToken failed. at ProcessExtension.ProcessExtensions.StartProcessAsCurrentUser(String appPath, String cmdLine, String workDir, Boolean visible) at Scheduler_Service.Service1.StartEXE(String s) at Scheduler_Service.Service1.folderfound(String path)

Iam using this in the network drive location