Delete directory regardless of 260 char limit

后端 未结 17 1755
無奈伤痛
無奈伤痛 2020-12-08 02:03

I\'m writing a simple script to delete USMT migration folders after a certain amount of days:

## Server List ##
$servers = \"Delorean\",\"Adelaide\",\"Brisba         


        
17条回答
  •  轮回少年
    2020-12-08 02:38

    Just as CADII said in another answer: Robocopy is able to create paths longer than the limit of 260 characters. Robocopy is also able to delete such paths. You can just mirror some empty folder over your path containing too long names in case you want to delete it.

    For example:

    robocopy C:\temp\some_empty_dir E:\temp\dir_containing_very_deep_structures /MIR
    

    Here's the Robocopy reference to know the parameters and various options.

提交回复
热议问题