使用自动运行Sandboxie运行文件

时间:2014-04-06 15:26:46

标签: autoit

我的文件路径是C:\ Documents and Settings \ 12313 \ My Documents \ Downloads \ Bubble_Hit_TSA31DIBX.exe

我想用sandboxie运行它,但无论何时重新下载,文件名都在变化。 例如:Buble_Hit_ ** .exe“*”正在更改。

1 个答案:

答案 0 :(得分:0)

您可以使用FileFindFirstFileFileFindNextFile的通配符功能从AutoIt轻松完成此操作。这些函数的帮助文件包含枚举与模式匹配的一组文件的示例,但您只对第一个文件感兴趣,因此只需要调用FileFindNextFile一次。

我会将其实现为如下函数:

; Returns the matching file name.
; If the file could not be found then return an empty string and sets @error to 1
Func _FindFile($wildcard)
    Local $hSearch = FileFindFirstFile($wildcard)
    If $hSearch = -1 Then Return SetError(1, 0, "")

    Local $ret = FileFindNextFile($hSearch)
    Local $found = Not @error
    FileClose($hSearch)

    If Not $found Then Return SetError(1, 0, "")
    Return $ret
EndFunc   ;==>_FindFile

然后将这样调用(查找Program Files (x86)):

MsgBox(0, "Test", _FindFile("C:\Program Files (*)"))

一旦你有了文件名然后Run(...)等等,其余部分应该是相当正常的东西,你可以找到帮助文件。

相关问题