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

阅读 95

2022-02-10

// 问题所在,没有切换路径
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)

0 0 举报