跳至主要内容

Use rmdir instead of del to delete the symblic link (itself) in windows to prevent data loss

Use rmdir if you want to remove just the directory symbolic link (by itself.)

When you begin to live with (make use of) symbolic links in windows. You may have to remove some symbolic links for maintenance.

It feels all okay until symbolic links whose target are directories, those created by /d parameters by `mklink` tool, comes into play.

Don't use the del command, as it will recursively delete all the files under the target directory.

Use rmdir to delete just the symbolic link itself.

Reference: https://superuser.com/questions/167076/how-can-i-delete-a-symbolic-link

评论