File tree Expand file tree Collapse file tree
src/libraries/System.Diagnostics.Process/src
Microsoft/Win32/SafeHandles Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -374,7 +374,7 @@ private static SafeProcessHandle StartWithShellExecute(ProcessStartInfo startInf
374374 if ( verb != string . Empty &&
375375 ! string . Equals ( verb , "open" , StringComparison . OrdinalIgnoreCase ) )
376376 {
377- throw new Win32Exception ( SR . Format ( SR . UseShellExecuteVerbNotSupported , verb ) ) ;
377+ throw new Win32Exception ( Interop . Errors . ERROR_NO_ASSOCIATION , SR . Format ( SR . UseShellExecuteVerbNotSupported , verb ) ) ;
378378 }
379379
380380 // On Windows, UseShellExecute of executables and scripts causes those files to be executed.
@@ -405,7 +405,7 @@ private static SafeProcessHandle StartWithShellExecute(ProcessStartInfo startInf
405405 }
406406
407407 // use default program to open file/url
408- filename = Process . GetPathToOpenFile ( ) ?? throw new Win32Exception ( SR . UseShellExecuteNoOpenProgram ) ;
408+ filename = Process . GetPathToOpenFile ( ) ?? throw new Win32Exception ( Interop . Errors . ERROR_NO_ASSOCIATION , SR . UseShellExecuteNoOpenProgram ) ;
409409 string [ ] openFileArgv = ProcessUtils . ParseArgv ( startInfo , filename , ignoreArguments : true ) ;
410410
411411 SafeProcessHandle result = ForkAndExecProcess (
Original file line number Diff line number Diff line change 391391 <value >The callback must return a positive process ID for the newly created process.</value >
392392 </data >
393393 <data name =" UseShellExecuteVerbNotSupported" xml : space =" preserve" >
394- <value >The verb '{0}' is not supported for UseShellExecute on this platform. Only the default verb is supported.</value >
394+ <value >The verb '{0}' is not supported for UseShellExecute on this platform. Only the default verb (an empty string or "open") is supported.</value >
395395 </data >
396396 <data name =" UseShellExecuteNoOpenProgram" xml : space =" preserve" >
397- <value >No application is associated with the specified file for UseShellExecute on this platform.</value >
397+ <value >No application is associated with the specified file or URL for UseShellExecute on this platform.</value >
398398 </data >
399399</root >
You can’t perform that action at this time.
0 commit comments