7 de jan. de 2017

Apagar arquivo com nome muito extenso




Assuming you are on windows:


What I always do is use subst to create a driveletter asccociation with part of the path.


Then go to the new driveletter and navigate to the files that have long names. You should now be able to rename/delete/etc them. The reason this works is because the path itself is no longer containing >255 chars.
To create a subst folder
Start a commandprompt (no admin privileges needed)
Use cd to navigate to the folder you want to go (you can use tab to autocomplete names
type subst j: . to create the driveletter association. (instead of the . you can also type the entire path)
Now in explorer you have a new letter. Go to it and do whatever you need to do to the .cache files.
Go back to your cmd window and type subst /d j: to remove the drive or alternatively, restart your pc.


EDIT: A trick I learned which can shorten this quite a bit. From the explorer window where you have trouble, click the addressbar so you can type in it, then type cmd and press Enter to start a command prompt at that location, then proceed at step 3. :)


EDIT2: Okay, this trick can be expanded even further. If you are in explorer at the right path, just type in subst j: . in the addressbar and press enter. A command window will pop up, execute the command and close again, and there you go, a new drive pops up in explorer.


fonte: http://superuser.com/questions/755298/how-to-delete-a-file-with-a-path-too-long-to-be-deleted

Nenhum comentário: