Cannot delete a file / sym-link with a trailing dot on Windows Server 2019

by Sep 22, 2025IT Tips0 comments

Unable to delete folder due to "Could not find item. This is no longer located..."

attrib -s -h -r "E:\dont migrate\*.*" /s /d

Trying rmdir on a parent directory failed

rmdir /s Temp
Temp, Are you sure (Y/N)? y
Temp\OICE_15_974FA576_32C1D314_1788\D93F4BC2. - The system cannot find the file specified.
Temp\OICE_15_974FA576_32C1D314_3498\899F446B. - The system cannot find the file specified.
Temp\OICE_15_974FA576_32C1D314_3743\3713D642. - The system cannot find the file specified.
Temp\OICE_15_974FA576_32C1D314_3743\BF5547DA. - The system cannot find the file specified.
Temp\OICE_15_974FA576_32C1D314_3B11\9AF463FB. - The system cannot find the file specified.
Temp\OICE_15_974FA576_32C1D314_4D2\91DB5188. - The system cannot find the file specified.

Attrib throwing these errors

The target of the symbolic link E:\path\to\bad\symlink_or_file\Temp\OICE_15_974FA576_32C1D314_1788\D93F4BC2. does not exist
The target of the symbolic link E:\path\to\bad\symlink_or_file\Temp\OICE_15_974FA576_32C1D314_3498\899F446B. does not exist
The target of the symbolic link E:\path\to\bad\symlink_or_file\Temp\OICE_15_974FA576_32C1D314_3743\3713D642. does not exist
The target of the symbolic link E:\path\to\bad\symlink_or_file\Temp\OICE_15_974FA576_32C1D314_3743\BF5547DA. does not exist
The target of the symbolic link E:\path\to\bad\symlink_or_file\Temp\OICE_15_974FA576_32C1D314_3B11\9AF463FB. does not exist
The target of the symbolic link E:\path\to\bad\symlink_or_file\Temp\OICE_15_974FA576_32C1D314_4D2\91DB5188. does not exist

The following command allowed me to delete the files

del /f "\\?\E:\path\to\bad\symlink_or_file\Temp\OICE_15_974FA576_32C1D314_3498\899F446B."
del /f "\\?\E:\path\to\bad\symlink_or_file\Temp\OICE_15_974FA576_32C1D314_3743\3713D642."
del /f "\\?\E:\path\to\bad\symlink_or_file\Temp\OICE_15_974FA576_32C1D314_3743\BF5547DA."
del /f "\\?\E:\path\to\bad\symlink_or_file\Temp\OICE_15_974FA576_32C1D314_3B11\9AF463FB."
del /f "\\?\E:\path\to\bad\symlink_or_file\Temp\OICE_15_974FA576_32C1D314_4D2\91DB5188."

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.