Skif_off
Gold Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору VBScript Код: Dim FSO, WshShell, objRegExp, Path, Tmp If (WScript.Arguments.Count <> 2) And (WScript.Arguments.Count <> 3) Then WScript.Quit If (WScript.Arguments.Count = 3) Then Tmp = WScript.Arguments(2) Set FSO = CreateObject("Scripting.FileSystemObject") Set WshShell = CreateObject("WScript.Shell") If FSO.FolderExists(WScript.Arguments(1)) Then WshShell.Run """" & WScript.Arguments(0) & """ """ & WScript.Arguments(1) & Tmp & """" Else Set objRegExp = CreateObject("VBScript.RegExp") Path = WScript.Arguments(1) objRegExp.Pattern = "\\[^\\]+\\?$" While 1 Path = objRegExp.Replace(Path, "") If FSO.FolderExists(Path) Then WshShell.Run """" & WScript.Arguments(0) & """ """ & Path & "\" & Tmp & """" WScript.Quit End If WEnd End If | Autoit Код: #NoTrayIcon Local $sPath, $sTmp If ($CmdLine[0] <> 2) And ($CmdLine[0] <> 3) Then Exit If $CmdLine[0] = 3 Then $sTmp = $CmdLine[3] If StringInStr(FileGetAttrib($CmdLine[2]), 'D') Then Run('"' & $CmdLine[1] & '" "' & $CmdLine[2] & $sTmp & '"', '', @SW_SHOW) Else $sPath = StringRegExpReplace($CmdLine[2], '\\[^\\]+\\?$', '', 1) While 1 If StringInStr(FileGetAttrib($sPath), 'D') Then Run('"' & $CmdLine[1] & '" "' & $sPath & '\' & $sTmp & '"', '', @SW_SHOW) ExitLoop EndIf $sPath = StringRegExpReplace($sPath, '\\[^\\]+\\?$', '', 1) WEnd EndIf |
|