Delete files and folders longer than 259 characters

Posted by admin - September 13, 2018

The Easy and fast way..

Import-Module -Name 'C:\AlphaFS\AlphaFS.dll

To delete a Folder use [Alphaleonis.Win32.Filesystem.Directory]::Delete("E:\SUPERLONGPATH\",$TRUE)

for Files it is [Alphaleonis.Win32.Filesystem.File]::Delete("E:\stupidfilewithatolongpath.txt", $TRUE)