即.Set WshShell = CreateObject("WScript.Shell")command = "卸载-windows-serivce.bat"msgbox 命令WshShell.Run ("cmd/C" & """" & command & """")设置 WshShell = 无I need to execute a batch file as part of the un-install process in a Windows installer project (standard OOTB VS 2008 installer project-vdproj). One cannot execute a bat file directly from the Custom Actions in the installer project, so I wrote a quick vbs script to call the required bat file.vbs code: Set WshShell = WScript.CreateObject( "WScript.Shell" )command = "uninstall-windows-serivce.bat"msgbox commandWshShell.Run ("cmd /C " & """" & command & """")Set WshShell = NothingWhen this script is run independent of the uninstall, it works perfectly. However, when run as part of the uninstall, it does not execute the bat file (but the message box is shown, so I know the vbs file is called). No errors reported (at least that I can tell). Why doesn't this script work as part of the "Uninstall Custom Action" 解决方案 I've run into this same problem and the issue is that you can't call WScript within the vbs file - you will need to JUST call CreateObjectie.Set WshShell = CreateObject( "WScript.Shell" )command = "uninstall-windows-serivce.bat"msgbox commandWshShell.Run ("cmd /C " & """" & command & """")Set WshShell = Nothing 这篇关于从 Windows Installer 自定义操作执行脚本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!