Spaces:
Running
Running
Commit
·
b99ff4c
1
Parent(s):
8349ea9
Added Claude killswitch for easier reload
Browse files- killClaude.ps1 +24 -0
killClaude.ps1
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
$claudePath = "C:\Users\colem\AppData\Local\AnthropicClaude\claude.exe"
|
2 |
+
|
3 |
+
# Get all processes named "claude"
|
4 |
+
$processes = Get-Process -Name "claude" -ErrorAction SilentlyContinue
|
5 |
+
|
6 |
+
foreach ($proc in $processes) {
|
7 |
+
try {
|
8 |
+
Write-Output "Killing process: $($proc.Name) (ID: $($proc.Id))"
|
9 |
+
Stop-Process -Id $proc.Id -Force -ErrorAction Stop
|
10 |
+
Start-Sleep -Milliseconds 300
|
11 |
+
}
|
12 |
+
catch {
|
13 |
+
Write-Output "Process with ID $($proc.Id) already exited or could not be terminated."
|
14 |
+
}
|
15 |
+
}
|
16 |
+
|
17 |
+
# Start the application again
|
18 |
+
if (Test-Path $claudePath) {
|
19 |
+
Write-Output "Restarting Claude..."
|
20 |
+
Start-Process $claudePath
|
21 |
+
}
|
22 |
+
else {
|
23 |
+
Write-Output "Error: Claude executable not found at $claudePath"
|
24 |
+
}
|