The differential startup program from the registry to the beginning of the startup folder

We have a simple application with a button that opens the event viewer using the start of the process.

 public static void OpenWindowsEventViewer(
            string computerDnsName,
            string userName,
            SecureString password,
            string domain)
        {
            Process.Start("eventvwr.exe", computerDnsName, userName, password, domain);
        }

When we run our tool from the registry using HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run, it starts normally, but the "eventvwr.exe" process does not start with the error: 'Invalid directory name.

Starting our tool using the startup folder (Start-> Programs-> Autostart) works fine.

What is the difference between these two ways, and can I do something to make it work, starting from the registry?

Edit: uninstalling SecureString makes it work ...

+3
source share
2

...

" " ?

Edit:

.

+2

eventvwr.exe:

Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "eventvwr.exe")
+1

All Articles