【发布时间】:2015-03-16 08:11:23
【问题描述】:
我无法让 vbs 与 iexpress 一起工作。 我正在尝试让 exe 文件打开一个 vbs,该 vbs 打开一个在 exe 中保存的 hta。但是当我这样做时,我得到一个位于 %temp% 中的空白 hta。
我的问题是;如何让 vbs 正确定位 iexpress 的解压缩位置,以便我的脚本打开从 exe 中提取的 hta 而不是空白的 %temp% 文件?
我试过这样做:
Set objShell = CreateObject("Wscript.Shell")
strPath = Wscript.ScriptFullName
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strPath)
strFolder = objFSO.GetParentFolderName(objFile)
CreateObject("WScript.Shell").Run "C:\Windows\System32\mshta.exe " &
CreateObject("WScript.Shell").CurrentDirectory &"\page.hta"
【问题讨论】:
-
查看stackoverflow.com/a/29043160/603855 是否有帮助(当前目录和脚本目录之间的差异)