Pages

August 4, 2013

Để xóa được thư mục khi đường dẫn quá dài


--------------------------------------

Script to Delete Folder when Path Too Long

This script will delete a folder even if the path is too long.
The script requires Robocopy, which comes with Vista and Windows 7, or you can download the exe for XP and Server 2003 and save it in C:\Windows\System32.
Save the script as DelFolder.bat, in C:\Windows\System32
Usage: DelFolder
@echo off
if {%1}=={} @echo Syntax: DelFolder FolderPath&goto :EOF
if not exist %1 @echo Syntax: DelFolder FolderPath - %1 NOT found.&goto :EOF
setlocal
set folder=%1
set MT="%TEMP%\DelFolder_%RANDOM%"
MD %MT%
RoboCopy %MT% %folder% /MIR
RD /S /Q %MT%
RD /S /Q %folder%
endlocal

No comments:

Post a Comment