vb调用cmd打开批处理后为什么不执行批处理?命令如下:
PrivateSubCommand1_Click()Open"E:\text.txt"ForAppendAs#1Close#1Open"E:\text.txt"ForOu...
Private Sub Command1_Click()
Open "E:\text.txt" For Append As #1
Close #1
Open "E:\text.txt" For Output As #1
Print #1, "shutdown -s"
Close #1
FileCopy "E:\text.txt", "E:\text.bat"
Shell "cmd /c e:\text.bat", vbHide
End Sub
点击批处理可以执行,但是在vb中单击按钮后cmd在工具栏一闪而过,而且貌似也没有执行批处理怎么回事? 展开
Open "E:\text.txt" For Append As #1
Close #1
Open "E:\text.txt" For Output As #1
Print #1, "shutdown -s"
Close #1
FileCopy "E:\text.txt", "E:\text.bat"
Shell "cmd /c e:\text.bat", vbHide
End Sub
点击批处理可以执行,但是在vb中单击按钮后cmd在工具栏一闪而过,而且貌似也没有执行批处理怎么回事? 展开
5个回答
展开全部
Private Sub Command1_Click()
Open "E:\text.txt" For Append As #1
Close #1
Open "E:\text.txt" For Output As #1
Print #1, "shutdown.exe -s" '要加".exe"吧
Close #1
FileCopy "E:\text.txt", "E:\text.bat"
Shell "cmd /c e:\text.bat", vbHide
End Sub
Open "E:\text.txt" For Append As #1
Close #1
Open "E:\text.txt" For Output As #1
Print #1, "shutdown.exe -s" '要加".exe"吧
Close #1
FileCopy "E:\text.txt", "E:\text.bat"
Shell "cmd /c e:\text.bat", vbHide
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Shell "cmd /c e:\text.bat", vbNormalFocus
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
改成
Shell "cmd /c start /MIN e:\text.bat", vbHide
Shell "cmd /c start /MIN e:\text.bat", vbHide
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
看得头晕,直接用API运行吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询