Deleting Troublesome files from Windows Servers

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…
Do this….
del E:\home\users\username\DATA_A~1.JPG

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: Logo

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s