0
点赞
收藏
分享

微信扫一扫

[vba]shell执行exe或者bat没有反应

非衣所思 2022-02-10 阅读 93
// 问题所在,没有切换路径
ChDir ThisWorkbook.Path

// 同步调用
Dim oShell As Object, ret As String
Set oShell = CreateObject("WSCript.shell")
ret = oShell.Run("test.exe " & " test.ini", 0, True)
'ret = oShell.Run(ThisWorkbook.Path & "\test.bat" & " test.ini rettest")
Set oShell = Nothing
举报

相关推荐

0 条评论