Files
CapSpace/SilentStart.vbs

21 lines
618 B
Plaintext

Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
' 获取当前 .vbs 脚本的完整路径
fullPath = WScript.ScriptFullName
' 获取该脚本所在的文件夹路径
currentDir = fso.GetParentFolderName(fullPath)
' 拼接出同目录下的 AutoStart.bat 完整路径
batPath = currentDir & "\AutoStart.bat"
' 检查文件是否存在,防止路径错误导致无反应
If fso.FileExists(batPath) Then
WshShell.Run chr(34) & batPath & chr(34), 0
Else
MsgBox "找不到文件: " & batPath, 16, "路径错误"
End If
Set WshShell = Nothing
Set fso = Nothing