Deleting Troublesome files from Windows Servers

Scenario…
If you have a windows server and a mac client, the mac will put resource fork files on your shares. These files sometimes are not removable or even readable by windows.
Sometimes a client (Win or Mac) will save an incredibly long file name to their home directory. When it comes to server migration or just cleaning them up they can be troublesome.
To remove them you have to get the DOS 8.3 equivalent filename and remove them on the command line.

Lets say the troubled file is a system file called ._dan
To remove it list the directory like this if the file had a hidden attribute…
dir /X E:\home\users\username\ /AH
From that list I found the file I was looking for and made this command to delete the file…
del /aH E:\home\users\username\_DAN~1

If the file was not hidden just remove the /AH…
del E:\home\users\username\_DAN~1

Or there is an incredibly long filename…
data=Ay5GWBeob_WIPLDYoIWcfVXxvZu9XwJ55OX7Ag,JPvjaA-P4_0vCD8DrIvOfUHUfyQbx-V29OHRfM6Do8qJhdQDHhXB8bs-LWy0uhuIswGKOYHSF3puXl4MjJkukEQ164C8vB7oFaR7pNSB11FfHg9u5lUPcL7FMb-5kd4yeDqL0EtvMHO6d2FI1ME8L1hUN75-X677MHZFO8T5mgmkPo_-t-HTU_Sl86jXV-0xRGFHbzJ.JPG
Do this….
del E:\home\users\username\DATA_A~1.JPG
Advertisements

About Craig Szymanski

Systems Administrator Photography Enthusiast
This entry was posted in Windows and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s