Windows 如何将批处理文件和vbs脚本组合成一个.exe

Windows 如何将批处理文件和vbs脚本组合成一个.exe,windows,batch-file,vbscript,Windows,Batch File,Vbscript,我希望能够将我为批处理文件制作的vbs脚本组合成一个最终用户的.exe,这样我就可以为它指定一个图标。我一直在网上寻找一种方法,但找不到任何有用的 我要组合此vbs脚本: Set oShell = CreateObject ("Wscript.Shell") Dim strArgs strArgs = "cmd /c CheckIn.bat" oShell.Run strArgs, 0, false 使用此批处理文件: @echo off REM A message to ask the

我希望能够将我为批处理文件制作的vbs脚本组合成一个最终用户的.exe,这样我就可以为它指定一个图标。我一直在网上寻找一种方法,但找不到任何有用的

我要组合此vbs脚本:

Set oShell = CreateObject ("Wscript.Shell") 
Dim strArgs
strArgs = "cmd /c CheckIn.bat"
oShell.Run strArgs, 0, false
使用此批处理文件:

@echo off

REM A message to ask the user to save their Outlook emails they have open

mshta javascript:alert("Please be sure to save any emails that you need in Outlook. Click OK to continue.");close();

REM This will stop DM, Email Marker, Email Filer, Interceptor, Papihost, and Outlook.
taskkill /IM DM.exe /F
taskkill /IM DMMarkEmail.exe /F
taskkill /IM EmailAutoBulkFiling.exe /F
taskkill /IM Interceptor.exe /F
taskkill /IM OUTLOOK.EXE /F
taskkill /IM PAPIHost.exe /F

REM This will delete the DM cache in Appdata under the current user
RMDIR /s /q "%userprofile%\Appdata\Roaming\OpenText\DM\Cache"

REM This will start all of the programs that were closed

REM DM and Interceptor restart when Outlook starts back up
START OUTLOOK.EXE

REM Commenting the Marker and Filer since some users don't want it

REM START DMMarkemail.exe
REM START Email AutoBulkFiling.exe
REM START "C:\Program Files\Open Text\DM Extensions\DM.exe"
REM START "C:\Program Files\Open Text\DM Extensions\Interceptor.exe"
REM START PAPIHost.exe
@echo off

我不确定目前是否有一种简单的方法让我无法理解,请提前感谢您的反馈。

如果您发送的taskkill没有/f,就像正常的结束一样。应提示用户保存电子邮件。您可以稍后将其与/f一起发送以强制关闭

实现所需功能的一种方法是将批处理命令放入vbs oShell.Run命令中。在执行命令之前,不需要将命令放入变量中,这会使代码混乱

乙二醇

然后看这篇关于如何转换为exe的文章


PS:您应该能够直接作为vb.net程序运行脚本,而不是在脚本控件中运行它。只需将vb.net的页眉和页脚放进去。

如果您发送的taskkill没有/f,就像正常的结束一样。应提示用户保存电子邮件。您可以稍后将其与/f一起发送以强制关闭

实现所需功能的一种方法是将批处理命令放入vbs oShell.Run命令中。在执行命令之前,不需要将命令放入变量中,这会使代码混乱

乙二醇

然后看这篇关于如何转换为exe的文章

PS:您应该能够直接作为vb.net程序运行脚本,而不是在脚本控件中运行它。只要把vb.net的页眉和页脚放进去

oShell.Run "taskkill /IM DM.exe /F", 0, false