6

I plugged my USB flash memory stick into a Mac and it gained some unwanted hidden folders. (See the question Prevent MacOS from making .* and ._* files for prevention.)

I'd now like to remove these from my drive but I ran into an issue. Inside the fseventsd folder is a subfolder that is not shown unless I disable "Hide protected operating system files" in folder options. I am then shown a folder icon with no name, and attempting to delete it results in no action and no error. Attempting to open it results in the error:

E:\fseventsd\ is not accessible

The filename, directory name, or volume label syntax is incorrect.

So I took a look using command prompt:

Command Prompt Hidden Folder View

I must admit, had I not known the parent folder was from Mac OSX I would have strongly suspected a virus, because the folder name renders as a smiley face in ASCII.

Apparently this is ASCII character "01":

Old ASCII chart

Any commands I issued in Command Prompt resulted in various syntax errors as well. I decided to try Powershell.

Unfortunately 1) I'm not very experienced with Powershell, and 2) it appears to have similar difficulty with the weird folder name. I got the following error in Powershell just trying to list the parent directory contents:

Get-ChildItem : Illegal characters in path.

Powershell Error

How can I delete this folder?

JYelton
  • 3,277

4 Answers4

8

I was able to "fix" this by running chkdsk /f on the drive. It converted the fseventsd folder to a file which was easily deleted. However, I don't know if this "fix" was because the subfolder appeared broken to chkdsk, or if there was something else on the volume that allowed this to work.

Offering this as an answer in case it works for others.

JYelton
  • 3,277
1

Unfortunately, there are some filenames that the Windows APIs can't handle.

If you just want to delete the files, you could move any files that you want to keep off the flash drive, then reformat the flash drive.

If you want to keep all of your files, you'll need to use another operating system to rename them - either return to the Mac that you used originally, or use a Linux Live CD.

Another option that would work - if you don't want to go to another computer or shut down Windows - is to install Linux inside Virtualbox. You could then use the USB filter driver to grant the Linux guest OS control over the USB drive, and rename the files within Virtualbox.

HDMI
  • 126
1

I'm pretty sure that there is a third way to do this, at least under Windows XP.

Right click on the file in explorer. The file name will have a weird placeholder in place of the illegal character. Remove it and close the properties window. It renames the file. At least it has in my experience.

Cheers

0

I have had the same problem and solved it as follows:

  • Install NFS on the Windows server of PC
  • Mount the Windows file on a Linux PC or in my case a Solaris Unix server
  • The Unix root user must have full access to the Windows PC
  • Remove the file's of folder from the Unix system with rm -r