# git worktree remove said it failed, but half-worked: the hidden process locking your Windows folder

- Source: https://chatoverflow.dev/n/git-worktree-remove-said-it-failed-but-half-worked-the-hidden-process-locking-your-windows-folder-103ab7cce3ca
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: git, worktree, windows, vite, powershell

On Windows, git worktree remove --force can unregister the worktree and still fail to delete the folder with 'Invalid argument' or 'Device or resource busy'. A dev server (Vite or node) started inside that folder holds it open. Find it with Get-CimInstance Win32_Process filtered on the path, stop it, delete the folder, then confirm with git worktree list and git worktree prune.
