【发布时间】:2017-02-23 01:53:34
【问题描述】:
我已将searching for a solution to an issue of wrapping an .hta file 转换为 .exe,因此用户只需点击即可。我正在处理的应用程序是批处理脚本的集合,这些脚本通过.hta 从 GUI 加载。我尝试了各种谷歌搜索解决方案,包括HTAEdit。所有这些似乎都没有正确创建 .exe,或者似乎很容易成为新的本地感染的目标。
HTAEdit 这似乎是最合法的解决方案一次工作,然后不断失败,所以我的问题如下:
- 假设下面的代码是正确的,是否有一个工具可以真正将 HTA 转换为 EXE?
- 虽然下面的代码有点长,但对于一般的编程新手来说,我不确定我是否搞砸了?
(以下代码在 HTAEditor 中有效,但每次我尝试转换它时,都无法完成转换。)
感谢您抽出宝贵时间,很抱歉这篇文章与我上面链接的文章相似,我在 Stack 或 Google 上都找不到更多解决方案。
<html>
<title>Foo</title>
<HTA:APPLICATION
ID="Foo"
APPLICATIONNAME="Foo"
BORDERSTYLE="raised"
ICON="Logos/icon.ico"
SINGLEINSTANCE="yes"
>
<SCRIPT LANGUAGE="VBScript">
Sub Window_onLoad
window.resizeTo 800,400
End Sub
Sub SubChooseScript
For Each Button In SecureOption
If Button.Checked Then
If Button.Value = "Category" Then
For Each objButton in RadioOption
If objButton.Checked Then
Select Case objButton.Value
Case "Selection One"
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "Scripts\foo.bat"
self.close()
Case "Selection Two"
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "Scripts\foo.bat"
self.close()
Case "Selection Three"
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "Scripts\foo.bat"
self.close()
Case Else
MsgBox "Something bad happened. Please try again"
self.close()
End Select
End If
Next
End If
End If
If Button.Checked Then
If Button.Value = "Category Two" Then
For Each objButton in RadioOption
If objButton.Checked Then
Select Case objButton.Value
Case "Selection One"
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "Scripts\foo.bat"
self.close()
Case "Selection Two"
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "Scripts\foo.bat"
self.close()
Case "Selection Three"
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "Scripts\foo.bat"
self.close()
Case Else
MsgBox "Something bad happened. Please try again"
self.close()
End Select
End If
Next
End If
End if
Next
End Sub
</SCRIPT>
<body>
<img src="Logos\logo.jpg" align="right" height="200" width="200"/>
<p><b>Radio Options One</b></p>
<div class="button-formatting">
<input type="radio" name="RadioOption" value="foo" id="foo"><b> <u>foo</u></b>
<label for="foo", style="font: 16px Arial"><i>-- bar.</i></label><BR>
<input type="radio" name="RadioOption" value="foo" id="foo"><b> <u>foo</u></b>
<label for="foo", style="font: 16px Arial"><i>-- bar.</i></label><BR>
<input type="radio" name="RadioOption" value="foo" id="foo"><b> <u>foo</u></b>
<label for="foo", style="font: 16px Arial"><i>-- bar.</i></label><P>
<p><b>Radio Options Two</b></p>
<input type="radio" name="foo" value="foo" id="foo"><b><u>foo</u></b>
<label for="foo", style="font: 16px Arial"><i>-- bar.</i></label><BR>
<input type="radio" name="foo" value="foo" id="foo"><b> <u>foo</u></b>
<label for="foo", style="font: 16px Arial"><i>-- bar.</i></label><BR>
</div><BR>
<input id=runbutton class="button" type="button" value="Options" name="run_button" onClick="SubChooseScript">
</body>
【问题讨论】:
-
Htaedit 还会在执行 exe 时将 exe 解压缩到可访问的文件夹结构中。我已经很久没有使用这些东西了,但我记得 htaedit 是商业的,所以你必须为在试用期后继续使用付费。
-
@Teemu 不,您不必付费,因为试用期永不过期。唯一的问题是,只要您不付款,就会收到烦人的“立即注册!”每次打开 HtaEdit 时都会出现对话框。
-
嗯.. 我记得 exe 转换在跟踪过程中只工作了几次,然后它停止工作,如果你不付钱。
标签: hta