Batch file .VBS//800a01c2参数数目错误“;“objshell.Run”;

Batch file .VBS//800a01c2参数数目错误“;“objshell.Run”;,batch-file,vbscript,Batch File,Vbscript,我想在我的USB驱动器上搜索一个.bat文件并运行它,当我尝试执行时出现问题,并给出以下错误: 第16行中的错误,字符1 800a01c2参数“objshell.Run”的数目错误 这是我的代码: Set objshell = WSH.CreateObject("WScript.Shell") Set fso = WSH.CreateObject("Scripting.FileSystemObject") Set drives = fso.Drives For Each drive in dr

我想在我的USB驱动器上搜索一个.bat文件并运行它,当我尝试执行时出现问题,并给出以下错误:

第16行中的错误,字符1 800a01c2参数“objshell.Run”的数目错误

这是我的代码:

Set objshell = WSH.CreateObject("WScript.Shell")
Set fso = WSH.CreateObject("Scripting.FileSystemObject")
Set drives = fso.Drives

For Each drive in drives
    batfile = drive.DriveLetter & ":\ZEC\NVIDIA\InstallerSin.bat"
    if fso.FileExists(batfile) Then Exit For
Next

If not fso.FileExists(batfile) Then
    WSH.Echo("bat script not found.")
    WSH.Quit(1)
End If

WSH.Echo("found it: " & batfile)
objshell.Run batfile, 0, True, vbhide

objshell.Run
最多接受三个参数。你用四个来称呼它


你需要解释你想用代码实现什么,而不是期望人们通过阅读代码来了解抱歉是我的第一篇文章,我有点迷路了,我想在我的USB驱动器上搜索一个.bat文件并运行它,我编辑后请接受、阅读和拒绝投票,没有评论似乎很反复无常。有什么原因吗?