How Call for a BAT script in UNC folder and avoid Win32Exception (0x80004005): The operation was canceled by the user

0

I use VS 2017 Community, Windows Forms app, and I try call to BAT script (in UNC folder):

Process.Start(@"\\sharefolder\editHosts.bat");

Sometimes I get the error:

ComponentModel.Win32Exception (0x80004005): The operation was canceled by the user
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()

I have already checked the following things:

  • The folder exists
  • The user has rights to the folder (can open it in Explorer)

Any suggestions?

c#
winforms
batch-file
scripting
asked on Stack Overflow Feb 6, 2019 by Kiquenet • edited Feb 6, 2019 by Micha Wiedenmann

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0