Category Archives: Microsoft Server 2003

Can’t Delete File/Folder – Path Too Long

I ran into a scenario where I had used Robocopy to /COPYALL out to an external USB drive for a backup of a rather large directory. One of the source directories had about 40 hidden subfolders stacked within itself which robocopy copied out to the external drive. All of these folders file paths on my external drive now surpassed the limit of 255 characters which essentially renders them useless in the GUI. These duplicate hidden subfolders were something that I wanted to:

– delete from the destination media

– exclude from any future robocopy copyouts

The quick fix I found was to drill down into the USB drive about half way through the nested subfolders, right-click and share one of the duplicates out, giving permission to ‘Everyone’. From my host PC, I was able to go to¬† \\SERVER\*newshare* and delete all subfolders/files from that point as the relative path was then lower than 255 characters. Go back into the server, remove the share, and move it higher up in the tree if necessary to work yourself out of the 255 character limit.

I then added the exclusion (in italics below) to my robocopy script to avoid copying that directory again and recreating the issue:

robocopy “C:\Graphics” “F:\Graphics” /NP /E /R:3 /W:5 /ZB /XD “C:\Graphics\Videos\Edits” /LOG:”C:\Backup_log.txt”

Clear Temporary Internet Files for All Users

I came across this utility from the folks over at Ctrl-Alt-Del Consulting which is great for reclaiming space taken by users temporary internet files stacking up over time. I’ve found it especially helpful on terminal servers with hundreds of users. Download their free tool ICSweep here:

Once downloaded, extract it to the root of C:\. Open an administrative command prompt and cd to the “C:\ICSweep” directory and reference the following switches:

ICSweep [/ALL|/TIF|/TMP] [/?]

  /ALL   -   Delete both Temporary Internet Files and Temp files
  /TIF   -   Delete Temporary Internet Files only (Default)
  /TMP   -   Delete Temp files only
  /SIZE  -   Report the size of both Temporary Internet Files
             and Temp files in each profile NOT in use. This
             switch will also report the total size of
             both Temporary Internet Files and Temp files NOT
             in use. It DOES NOT DELETE any files.
  /?     -   show this help file