Jump to content

How to delete files that start with illegal characters from the Comman


Recommended Posts


I'm currently dual booting Windows XP Pro and OS X Leopard on my system. I recently installed Paragon NTFS to gain write access to my NTFS partitions. All is well so far with the exception of one annoying problem. Every OS X session leaves behind some files on my NTFS partitions (.Trashes, ._.Trashes ..etc) This happens everytime I boot back into XP from OS X. I can delete these junk folders and files from Explorer without incident so I thought I would write up a little Batch Script to do it for me at Startup.

Given it's unix nature, The OS X files all start with what XP would consider illegal characters namely periods. I can delete the offending folders from the commandline without any problems but the files always come back with a "File not found" error. I've searched around and can't seem to find out why this is. I also cannot rename or move the offending files from the commandline.

Here's what I mean in way of an example:

@echo off
title Cleaning up OS X junk files


echo Cleaning up OS X junk files ...


REM The Removal of the Folder named .Trashes is successful

del /Q %SYSTEMDRIVE%\._.Trashes

REM Comes back with an error telling me it cannot find the file specified
REM The MOVE and RENAME commands give the same message

Note that I can delete all files and folder starting with illegal characters from Explorer.

Any help would be appreciated - Thanks. :thumbup

Link to comment
Share on other sites

Not sure if it works for your periods, but generally you can delete files with illegal characters by applying a '?' wildcard. So deleting ._.Trashes should be done by 'del ?_.Trashes', or maybe 'del .\?_.Trashes'. Of course this will delete all files with this pattern.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.

  • Create New...