How to unlink a folder in Windows? (NTFS)

2

Is it possible to unlink a folder in NTFS rather than delete it? ie. Can I simply delete it from the filetable?

The reason I want to do this is because I have a bunch of stuff that I've copied off from a Linux computer, and it seems that ntfs3g has done something funny in allowing filenames that shouldn't have been (for instance pipes in filenames) as well as linking some things... for instance ".wine/dosdevices/c:" is being recognised as a link to my c drive and it won't delete it without clearing out my windows drive! So I thought that perhaps I could just unlink the .wine directory and be done with it, except I can't work out how.

Matthew Scharley

Posted 2009-08-27T04:16:59.360

Reputation: 4 083

Answers

1

I would suggest remounting over NTFS-3G and cleaning up from there rather than the native NTFS delete attempts.

In fact if might be easier if you can delete the entire copy from NTFS-3G and
copy again skipping special files (links, pipes, et al).

nik

Posted 2009-08-27T04:16:59.360

Reputation: 50 788

Sadly I can't retake the copy, since it's a backup of a computer that I just reinstalled with Windows. I might pick up one of my livecds though and do it from ntfs-3g again though. – Matthew Scharley – 2009-08-27T04:36:02.113

I would have also suggested a try with Cygwin on Windows, but I think its safer the NTFS-3G way. – nik – 2009-08-27T04:40:51.993

2

Windows has command line fsutil utility. You could use it to manage links.

Kirill V. Lyadvinsky

Posted 2009-08-27T04:16:59.360

Reputation: 5 028

0

Have you tried connecting to your Windows machine via SMB from a Linux or OSX machine and deleting the files over that connection? I've run into a similar situation in the past and that worked for me.

arathorn

Posted 2009-08-27T04:16:59.360

Reputation: 8 559

0

Delete the files using the explicit paths: del "\\?\C:\some\absolute\path\.wine\dosdevices\c:".

Ark-kun

Posted 2009-08-27T04:16:59.360

Reputation: 129