104
20
I believe in Windows Vista, we could use linkd
command. However, I cannot find this command in Windows 7. I know I can use Windows Explorer and delete the junction, but I wonder if this can be done in Command Prompt.
I can use mklink
command to create a junction from a Command Prompt, so, what is the opposite of it (something like linkd
)?
20This does not work in Powershell - it will follow the junction and delete all files. Use cmd /c "rmdir mydir". – Brian Low – 2014-09-15T06:00:52.503
1@BrianLow: Wat. – user1686 – 2014-09-15T06:29:07.183
3
@grawity Seems to for me: https://gist.github.com/brianlow/0d5d2070c87c378454d7
– Brian Low – 2014-09-16T01:46:46.2101rmdir tells dir is not empty for junction – Sergey – 2018-10-16T16:34:31.733
2@gravity, thanks! rd works while del does not. – Nord – 2011-05-19T05:45:27.760
Owh.. I mean @grawity (not @gravity) in my previous comment. Please accept my apology. – Nord – 2011-05-19T05:53:49.033
6As a Linux user I really struggled to find this. Thanks so much! – Jonathon Reinhart – 2011-10-28T01:05:19.370
2@JonathonReinhart I resonate well with that. If only Windows started used swap and ext4 without third-party software! – mjohnsonengr – 2012-08-15T16:02:21.793
5@Vi3GameHkr: If only Linux started using ntfs without third-party software... /// Windows does use swap, it just calls it "paging file". – user1686 – 2012-09-07T13:05:59.497
Thanks :) This works fine. I didn't want to do it in Explorer as it may delete the target stuff too. – Adambean – 2013-08-23T14:40:51.937
For some reason this didn't work for me. I had to do the following in a console with administrator privileges first: fsutil reparsepoint delete C:\Path\To\Junction – Zugwalt – 2014-03-27T16:55:36.540