0

I have an executable which on startup creates/opens a registry entry in HKCU/Software with key.CreateSubkey("Newkey", true) and set a subkey value with key.SetValue("Subkey",Test"). The key and subkey are created when the executable is launched via a .bat file, but the subkey is not created with key.SetValue when the executable is launched from a c# application via Process.Start with the following code. No error is thrown by the executable.

            Process p2 = new Process();
            p2.StartInfo = new ProcessStartInfo(sSplashTimeExe);           
            p2.StartInfo.Verb = "open";
           
            string sArgs2 =sTimeInSecs + " \"Estimated action time = " +sTimeInSecs + " secs.\" \"" + 
                sCancelLabel +" \" " + " " + sCancelexe ;
            p2.StartInfo.Arguments = sArgs2;
            p2.StartInfo.UseShellExecute = true;
            p2.Start();

If the executable is run from a .bat batch file which is launched with System.Diagnostics.Process.Start(sBatchFileName) the Registry subkey is created OK.

SimonKravis
  • 553
  • 1
  • 3
  • 24

0 Answers0