Skif_off
Gold Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору VBScript: Код: Dim FSO, WshShell, objRegExp, Path If (WScript.Arguments.Count <> 2) Then WScript.Quit 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) & """" 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 & """" WScript.Quit End If WEnd End If | AutoIt: Код: #NoTrayIcon Local $sPath If $CmdLine[0] <> 2 Then Exit If StringInStr(FileGetAttrib($CmdLine[2]), 'D') Then Run('"' & $CmdLine[1] & '" "' & $CmdLine[2] & '"', '', @SW_SHOW) Else $sPath = StringRegExpReplace($CmdLine[2], '\\[^\\]+\\?$', '', 1) While 1 If StringInStr(FileGetAttrib($sPath), 'D') Then Run('"' & $CmdLine[1] & '" "' & $sPath & '"', '', @SW_SHOW) ExitLoop EndIf $sPath = StringRegExpReplace($sPath, '\\[^\\]+\\?$', '', 1) WEnd EndIf |
| Всего записей: 6487 | Зарегистр. 28-01-2008 | Отправлено: 06:11 26-07-2018 | Исправлено: Skif_off, 17:23 26-07-2018 |
|