Monday, September 15, 2014

How to delete a broken symbolic file link in Windows

So I have a file in a directory with an unicode name. I wanted to create a link to this elsewhere, but when I tried to do it with a command like mklink file "S:\ディレクトリ\target" in cmd.exe, the result was a broken symlink (the unicode characters showed up as boxes in the command). Running attrib on the links just says "The target of the symbolic link file does not exist", so it certainly seems broken for good.


And now the really annoying part about this: I can't delete the damn thing. Trying to do it in Explorer just tells me I can't, trying to use del from an elevated prompt just gives me "Access is denied." Trying to overwrite the symlink with a new (working) one doesn't work either, just gives me "Cannot create a file when that file already exists."


So, how could I go about deleting this? And as a bonus question, any ideas on how to get symbolic links for unicode paths working?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...