-3

I am trying to run an exe file from my own machine:

string versionInFolder = @"c:\test.exe";
public void Install(string versionInFolder)
        {
            ProcessStartInfo processStartInfo = new ProcessStartInfo
            {
                CreateNoWindow = true,
                UseShellExecute = false,
                FileName = versionInFolder,
                WindowStyle = ProcessWindowStyle.Hidden,
            };
            using (Process process = Process.Start(processStartInfo))
            {
                process.WaitForExit();
            }
        }

This file exist and can run manually but i got this error:

System.ComponentModel.Win32Exception: 'The requested operation requires elevation'

I found this post but did not understand the reason for this error and how to solve it.

Dal Raz
  • 19
  • 1
  • 7

1 Answers1

0

You need to run your programm as admininistrator. Check that first.

And if that doesn't work, or if you're the administrator, try to move your file in another place.

MrOizo
  • 16
  • 3