Show / Hide Table of Contents

Method run.itSafe


Overload

Calls run.it and handles exceptions. If it throws exception, writes it to the output as warning and returns null.

public static RResult itSafe(string file, string args = null, RFlags flags = 0, ROptions dirEtc = null)
Parameters
file  (string)

Examples:

  • @"C:\file.txt"
  • folders.Documents
  • folders.System + "notepad.exe"
  • @"%folders.System%\notepad.exe"
  • @"%TMP%\file.txt"
  • "notepad.exe"
  • @"..\folder\x.exe"
  • "http://a.b.c/d"
  • "file:///path"
  • "mailto:[email protected]"
  • ":: ITEMIDLIST"
  • @"shell:::{CLSID}"
  • @"shell:AppsFolder\Microsoft.WindowsCalculator_8wekyb3d8bbwe!App".
args  (string)

Command line arguments. This function expands environment variables if starts with "%" or "\"%".

flags  (RFlags)
dirEtc  (ROptions)

Allows to specify more parameters: current directory, verb, etc. If string, it sets initial current directory for the new process. If "", gets it from file. More info: ROptions.CurrentDirectory.

Returns
RResult

Remarks

This function is useful when you don't care whether it succeeded and don't want to use try/catch. Handles only exception of type AuException. It is thrown when fails, usually when the file does not exist.

See Also

print.warning
OWarnings.Disable
wnd.findOrRun