vb 自杀程序问题
想做一个投票端,投票完成后自动删除,不用安装的,网上找到的代码是用bat执行,但是在其他电脑上不能自动执行bat文件,请问有什么办法吗,不打包安装的办法。
自杀代码如下
Sub KillMe()
Open App.path & "\temp.bat" For Output As #1
Print #1, "@echo off" '"@echo off" 不显示执行过程
Print #1, "sleep 100"
Print #1, "del " & App.EXEName + ".exe" 'temp.bat 删除指定文件
Print #1, "del " & DZ 'temp.bat 删除指定文件
Print #1, "del temp.bat" 'temp.bat 删除自身
Print #1, "cls"
Print #1, "exit"
Close #1
Shell App.path & "\temp.bat", vbHideEnd
End Sub