forked from Wechat-ggGitHub/wechat-claude-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop.vbs
More file actions
27 lines (21 loc) · 872 Bytes
/
stop.vbs
File metadata and controls
27 lines (21 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Option Explicit
Dim shell, fso, projectDir, scriptPath, logDir, logPath, cmd
Set shell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
projectDir = fso.GetParentFolderName(WScript.ScriptFullName)
scriptPath = fso.BuildPath(projectDir, "stop-windows.cmd")
logDir = shell.ExpandEnvironmentStrings("%USERPROFILE%") & "\.wechat-opencode\logs"
logPath = fso.BuildPath(logDir, "windows-stop.log")
EnsureFolder logDir
cmd = "cmd.exe /c " & Quote(Quote(scriptPath) & " --no-pause > " & Quote(logPath) & " 2>&1")
shell.Run cmd, 0, False
Function Quote(value)
Quote = Chr(34) & value & Chr(34)
End Function
Sub EnsureFolder(path)
Dim parent
If fso.FolderExists(path) Then Exit Sub
parent = fso.GetParentFolderName(path)
If Len(parent) > 0 And Not fso.FolderExists(parent) Then EnsureFolder parent
fso.CreateFolder path
End Sub