- OpenClaw's official documentation currently has no Windows removal guide -- Linux commands like
systemctl disableandrm -rfdo not apply on Windows, requiring a dedicated removal workflow openclaw gateway uninstallcannot fully clear Scheduled Tasks on Windows; residual scheduled tasks will attempt to start the now-nonexistent Gateway on every boot, generating error events- Complete removal requires six steps: stop processes -> unregister scheduled tasks -> npm global uninstall -> delete configuration directory -> delete logs and cache -> verify cleanup; skipping any step will leave residual files
- OpenClaw residuals in the Windows native environment are scattered across at least four locations:
%USERPROFILE%\.openclaw\,%APPDATA%\npm\,%LOCALAPPDATA%\openclaw-logs\, and Windows Task Scheduler
1. Why a Windows-Specific Removal Guide Is Needed
After completing the OpenClaw Windows Native Installation, the next natural question is: if you decide not to continue using it, how do you completely remove it?
This seems like a simple question, but our hands-on testing revealed the situation is far more complex than expected. OpenClaw's official documentation[1] provides removal steps for Linux environments (systemctl stop, systemctl disable, rm -rf ~/.openclaw), but has absolutely no Windows removal guide. More critically, the persistence mechanism OpenClaw uses on Windows (Scheduled Tasks) is fundamentally different from Linux (systemd)[3], so Linux removal steps cannot be directly applied.
During our hands-on removal testing, we encountered multiple pitfalls: the openclaw gateway uninstall command appeared to succeed but actually left Scheduled Task residuals behind, non-administrator privileges couldn't delete scheduled tasks, and the Gateway process continued running orphaned after removal. This article fully documents our field experience, providing a reproducible Windows removal workflow.
2. Pre-Removal Confirmation
Before starting the removal, confirm the following:
2.1 Confirm Installation Method
This article's removal workflow applies to the following installation methods:
- PowerShell one-line install (
iwr -useb https://openclaw.ai/install.ps1 | iex) - npm global install (
npm install -g openclaw)
If you installed via WSL2, refer to the Linux removal steps in the Windows Deployment Complete Guide.
2.2 Back Up Important Data
Before removal, check if there's any data you need to keep:
# Check OpenClaw configuration file
type %USERPROFILE%\.openclaw\openclaw.json
# Check conversation history
dir %USERPROFILE%\.openclaw\sessions\
If you configured custom API Keys, Telegram Bot Tokens, or other integration settings in openclaw.json, we recommend making a backup copy first.
3. Six-Step Complete Removal Workflow
The following six steps must be executed in order. We recommend opening PowerShell as Administrator to ensure sufficient privileges for all operations.
Step 1: Stop Daemon and Gateway Processes
First, stop all running OpenClaw processes:
openclaw daemon stop
In our testing, the output was:
Stopped Scheduled Task: OpenClaw Gateway
After stopping, run openclaw gateway status to confirm the state. We saw the following response:
Service: Scheduled Task (registered)
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Runtime: stopped (state Ready, last run time 2026/2/27 06:43:26)
RPC probe: ok
Service is loaded but not running (likely exited immediately).
Note the key phrase: "Service is loaded but not running" -- the process has stopped, but the Scheduled Task remains in registered state. This is what Step 2 needs to address.
If openclaw daemon stop doesn't respond or fails, you can find the Gateway process via WMIC and force terminate it:
# Find openclaw-related Node.js processes
WMIC process where "name='node.exe'" get ProcessId,CommandLine | findstr /i "openclaw"
# Example output:
# "C:\Program Files\nodejs\node.exe" ...openclaw\dist\index.js gateway --port 18789 26472
# Force terminate
taskkill /F /PID 26472
Note: If you ran the Gateway in the background using Start-Job, you need to stop the PowerShell Job first:
# List background Jobs
Get-Job
# Stop and remove Jobs
Get-Job | Stop-Job
Get-Job | Remove-Job
Step 2: Unregister Scheduled Task
This is the step most prone to errors in the Windows removal process. If you ever ran openclaw gateway install, there will be an auto-start scheduled task in the system[3].
# First try OpenClaw's built-in uninstall command
openclaw daemon uninstall
# Or
openclaw gateway uninstall
In our testing, both commands were tried, but neither could fully clean up:
$ openclaw daemon uninstall
Stopped Scheduled Task: OpenClaw Gateway
Removed task script: C:\Users\HYC\.openclaw\gateway.cmd
Gateway service still loaded after uninstall.
$ openclaw gateway uninstall
Stopped Scheduled Task: OpenClaw Gateway
Task script not found at C:\Users\HYC\.openclaw\gateway.cmd
Gateway service still loaded after uninstall.
Note the critical error message: "Gateway service still loaded after uninstall". This means while the script file was removed, the Windows Scheduled Task registration still exists.
You need to open PowerShell as Administrator and manually unregister using Unregister-ScheduledTask[4]:
# Run in Administrator PowerShell
Unregister-ScheduledTask -TaskName "OpenClaw Gateway" -Confirm:$false
Verify the scheduled task was actually removed:
# If cleared, this command should return no results
Get-ScheduledTask | Where-Object {$_.TaskName -like "*OpenClaw*"}
Step 3: npm Global Uninstall
npm uninstall -g openclaw
In our testing, the output was:
removed 682 packages in 7s
Verify successful removal:
openclaw --version
# Should display 'openclaw' is not recognized
If openclaw --version still works, your system may have multiple Node.js installations (e.g., multiple versions managed by nvm), and you'll need to run npm uninstall -g openclaw under each Node.js version.
Step 4: Delete Configuration Directory
All of OpenClaw's settings, session data, and OAuth tokens are stored under the user directory[4]:
# Delete OpenClaw configuration directory
Remove-Item -Recurse -Force "$env:USERPROFILE\.openclaw"
# Verify
Test-Path "$env:USERPROFILE\.openclaw"
# Should return False
In our testing, the complete contents of this directory were:
$ ls ~/.openclaw/
agents/ canvas/ completions/ credentials/ cron/ devices/
identity/ logs/ memory/ telegram/ workspace/
openclaw.json openclaw.json.bak openclaw.json.bak.1
openclaw.json.bak.2 openclaw.json.bak.3 update-check.json
Key contents include:
openclaw.json(and multiple.bakbackups) -- main configuration file, containing API Keys, Telegram Token, Gateway settingsagents/,canvas/,completions/-- agent configurations and conversation historycredentials/,identity/-- authentication and identity informationtelegram/-- Telegram Bot integration datamemory/-- semantic memory storagecron/-- scheduled task configurations
Step 5: Delete Logs and Cache
OpenClaw's logs and cache on Windows may be scattered across the following locations:
In our testing, OpenClaw's log files were located at /tmp/openclaw/ (Git Bash environment) or C:\tmp\openclaw\ (Windows native path):
# If installed/used via Git Bash
Remove-Item -Recurse -Force "C:\tmp\openclaw" -ErrorAction SilentlyContinue
# Standard Windows log location
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\openclaw-logs" -ErrorAction SilentlyContinue
# Check if global node_modules has residuals
dir "$env:APPDATA\npm\node_modules\" | findstr /i "openclaw"
If node_modules still contains an openclaw directory, delete it manually:
Remove-Item -Recurse -Force "$env:APPDATA\npm\node_modules\openclaw" -ErrorAction SilentlyContinue
Step 6: Verify Complete Removal
Run the following checklist to confirm all residuals have been cleared:
# 1. Command no longer exists
openclaw --version
# Expected: 'openclaw' is not recognized
# 2. Configuration directory deleted
Test-Path "$env:USERPROFILE\.openclaw"
# Expected: False
# 3. Scheduled task removed
schtasks /Query /TN "OpenClaw*" 2>$null
# Expected: ERROR: The system cannot find the path specified.
# 4. No residual processes
tasklist | findstr /i "openclaw"
# Expected: No output
# 5. Log directory deleted
Test-Path "$env:LOCALAPPDATA\openclaw-logs"
# Expected: False
If all five checks pass, OpenClaw has been completely removed from your Windows system.
4. Pitfall Log
The following are specific issues we encountered during hands-on removal testing and their solutions:
Pitfall #1: daemon/gateway uninstall Both Fail to Fully Clear Scheduled Task
Symptoms: Running openclaw daemon uninstall and openclaw gateway uninstall, both output "Gateway service still loaded after uninstall", and PowerShell queries still find the scheduled task:
$ powershell -Command 'Get-ScheduledTask | Where-Object {$_.TaskName -like "*OpenClaw*"}'
TaskPath TaskName State
-------- -------- -----
\ OpenClaw Gateway Ready
Root cause: OpenClaw's uninstall command removes the gateway.cmd script file, but the underlying schtasks /Delete call silently fails without administrator privileges, failing to actually delete the registration in Windows Task Scheduler.
Solution: Open PowerShell as Administrator and manually unregister[4]:
# Administrator PowerShell
Unregister-ScheduledTask -TaskName "OpenClaw Gateway" -Confirm:$false
Pitfall #2: HRESULT 0x80070005 Error Without Administrator Privileges
Symptoms: Running Unregister-ScheduledTask in non-administrator PowerShell produces the following error:
Unregister-ScheduledTask : Access is denied.
+ CategoryInfo : PermissionDenied: (PS_ScheduledTask:Root/Microsoft/...T_ScheduledTask)
[Unregister-ScheduledTask], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070005,Unregister-ScheduledTask
Root cause: openclaw gateway install creates the scheduled task with administrator privileges[3], and deletion also requires administrator privileges. HRESULT 0x80070005 is Windows' ACCESS_DENIED error code.
Solution: Reopen PowerShell as System Administrator:
# Right-click PowerShell -> Run as Administrator
# Or elevate a single command from existing PowerShell
Start-Process powershell -Verb RunAs -ArgumentList "-Command Unregister-ScheduledTask -TaskName 'OpenClaw Gateway' -Confirm:`$false"
Pitfall #3: Orphaned Gateway Process Occupying Port 18789
Symptoms: After running npm uninstall -g openclaw, the Gateway's Node.js process is still running in the background, occupying port 18789.
Root cause: If the Gateway process isn't stopped before removing the npm package, the Node.js child process becomes an orphan process. In our testing, we found this process via WMIC:
$ WMIC process where "name='node.exe'" get ProcessId,CommandLine | findstr /i "openclaw"
"C:\Program Files\nodejs\node.exe" ...\openclaw\dist\index.js gateway --port 18789 26472
Solution:
# Force terminate the process
taskkill /F /PID 26472
# SUCCESS: The process with PID 26472 has been terminated.
This is why we recommend Step 1 (stop processes) must be executed before Step 3 (npm removal).
Pitfall #4: Path Escaping Issues in Git Bash
Symptoms: Running schtasks in Git Bash produces inexplicable errors:
$ schtasks /Delete /TN "OpenClaw Gateway" /F
ERROR: Invalid argument/option - 'C:/Program Files/Git/Delete'.
Type "SCHTASKS /QUERY /?" for usage.
Root cause: Git Bash (MSYS2) automatically converts arguments starting with / to Windows paths[5]. /Delete gets interpreted as C:/Program Files/Git/Delete, causing schtasks to receive completely wrong parameters. Even attempting to route through cmd, quote handling causes issues:
$ cmd //c 'schtasks /Delete /TN "OpenClaw Gateway" /F'
ERROR: Invalid argument/option - 'Gateway"'.
Type "SCHTASKS /DELETE /?" for usage.
Solution:
# Method 1: Double slashes to bypass path conversion
schtasks //Delete //TN "OpenClaw Gateway" //F
# Method 2: Temporarily disable path conversion
MSYS_NO_PATHCONV=1 schtasks /Delete /TN "OpenClaw Gateway" /F
# Method 3 (recommended): Call PowerShell directly from Git Bash
powershell.exe -Command "Unregister-ScheduledTask -TaskName 'OpenClaw Gateway' -Confirm:`$false"
# Method 4 (best): Use PowerShell or CMD instead of Git Bash
5. Windows vs Linux Removal Comparison
| Step | Windows (Native) | Linux / WSL2 |
|---|---|---|
| Stop service | openclaw gateway stop + taskkill | systemctl stop openclaw-gateway |
| Unregister service | Unregister-ScheduledTask (requires admin) | systemctl --user disable openclaw-gateway |
| Remove package | npm uninstall -g openclaw | npm uninstall -g openclaw |
| Delete config | Remove-Item ~\.openclaw | rm -rf ~/.openclaw |
| Delete logs | Remove-Item C:\tmp\openclaw | rm -rf /tmp/openclaw |
| Verify | Get-ScheduledTask + WMIC | systemctl list-units + ps aux |
| Requires admin | Yes (for deleting scheduled tasks) | No (systemctl --user) |
| Primary pitfall | Scheduled Task residuals | systemd unit file residuals |
6. Post-Removal Checklist
The following is a complete post-removal verification checklist. We recommend checking each item after removal is complete:
| Check Item | Check Command | Expected Result |
|---|---|---|
| openclaw command | openclaw --version | not recognized |
| Configuration directory | Test-Path ~\.openclaw | False |
| Scheduled task | schtasks /Query /TN "OpenClaw*" | path not found |
| Residual processes | netstat -ano | findstr 18789 | No output |
| Log directory | Test-Path $env:LOCALAPPDATA\openclaw-logs | False |
| npm global package | npm list -g openclaw | empty / not found |
| Startup folder | dir "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup" | findstr openclaw | No output |
If all seven checks pass, your Windows system has been completely cleared of all OpenClaw traces.
Conclusion
Looking back at the entire removal workflow, the core issue can be summarized in one sentence: OpenClaw's installation is one command, but removal requires six steps -- and the official documentation only covers one of them.
npm uninstall -g openclaw does remove OpenClaw's executable, but it doesn't clear the configuration directory, doesn't unregister the Scheduled Task, and doesn't stop the already-running Gateway process. These residuals not only take up disk space but also generate error events on every boot -- the Scheduled Task attempts to start a program that no longer exists, and the Windows Event Viewer accumulates numerous failure records.
For technical teams evaluating AI agent tools, "can be safely removed" is equally important as "easy to install." A tool that can't be cleanly uninstalled increases uncertainty in technical debt assessment[2]. We hope this field-tested guide lowers the risk of trying OpenClaw in your Windows environment -- knowing you can completely remove it makes it easier to start experimenting.
If you encounter issues during removal not covered in this article, feel free to reach out to our research team. We will continue tracking OpenClaw's Windows platform support progress, including official improvements to the removal process.



