Skip to content

Instantly share code, notes, and snippets.

@lichengwu
Created November 11, 2012 08:03
Show Gist options
  • Save lichengwu/4054127 to your computer and use it in GitHub Desktop.
Save lichengwu/4054127 to your computer and use it in GitHub Desktop.
win7/win8强制删除文件夹
@echo off
set /p path=path:
set /p user=user:
rem 我们需要修改文件或目录的所有者
takeown /F %path% /R
rem 给用户授权文件夹或文件的完全控制权限
icacls %path% /grant %user%:F /t
rem 删除
rd /s /q %path%
del %path%
@echo finish...
@pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment