#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile_x64=C:\File.Installer\RTF_SHellExPrint.exe #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;#include Global $sFile = "Test.rtf" Global $sPara = "" Global $sWorkDir = "" Global $sVerb = 'Print' Global $SW_Mode = @SW_HIDE Global $iTimeOut = 100 ;Time in sec to wait for File Global $sAllowed_Verbs = 'Open, Edit, Print' If ($CmdLine[0] >= 1 And $CmdLine[1] <> '') Then $sFile = String($CmdLine[1]) If ($CmdLine[0] >= 2 And $CmdLine[2] <> '') Then $sPara = String($CmdLine[2]) If ($CmdLine[0] >= 3 And $CmdLine[3] <> '') Then $sWorkDir = String($CmdLine[3]) If ($CmdLine[0] >= 4 And $CmdLine[4] <> '') Then $sMode = String($CmdLine[4]) If ($CmdLine[0] >= 5 And $CmdLine[5] <> '') Then $SW_Mode = $CmdLine[5] If ($CmdLine[0] >= 6 And $CmdLine[6] <> '') Then $iTimeOut = Int($CmdLine[6]) $sFile = StringReplace($sFile, '%20', ' ') If Not StringInStr($sAllowed_Verbs, $sVerb) Then $sVerb = 'Open' ;_ArrayDisplay($CmdLine) Global $hDtStart = TimerInit(), $iDtWait While Not FileExists($sFile) Sleep(100) $iDtWait = TimerDiff($hDtStart) / 1000 If $iDtWait > $iTimeOut then Exit -1 WEnd Global $iPid = ShellExecute($sFile, $sPara, $sWorkDir, $sVerb, $SW_Mode) ;MsgBox(64, 'PID ', $iPid, 5) Exit Int($iPid)