0

I start a process:

Process process = new Process
        {
            StartInfo =
            {
                FileName = wFileLocation,
                Arguments = arguments + currentUrl,
                WindowStyle = ProcessWindowStyle.Normal
            }
        };
        process.Start();
        process.WaitForExit();
        process.Close();

The problem is that windows asks me whether it is worth opening a file, it can be dangerous. How to avoid this?

Is windows API (find window and imitate click on accept) can solve this problem?

HelloWorld
  • 635
  • 1
  • 7
  • 17
  • You can disable UAC :) or see https://stackoverflow.com/questions/6164782/executing-a-process-from-net-application-without-uac-prompt – Roman Marusyk Feb 09 '18 at 10:05
  • If you could bypass UAC that easily by simulating a click, every school boy and his dog would be writing nefarious software – TheGeneral Feb 09 '18 at 10:10
  • If my mouse can bypass UAC by clicking, why my dog can't? – Drag and Drop Feb 09 '18 at 10:13
  • @DragandDrop lack of apposable thumbs – TheGeneral Feb 09 '18 at 10:16
  • (https://stackoverflow.com/questions/2818179/how-do-i-force-my-net-application-to-run-as-administrator) check this – shrot Feb 09 '18 at 10:51
  • 1
    This isn't about UAC, it's about running a downloaded application. See [Unblock File from within .net 4 c#](https://stackoverflow.com/questions/6374673/unblock-file-from-within-net-4-c-sharp). – CodeCaster Feb 09 '18 at 11:12

0 Answers0