I've created a directory using QDir
but the given name had two dots in the end, Qt created this directory although its bad naming, and now my windows 10 OS cannot operate on this invalid directory.
I cannot do any operation on it. I've done these:
chkdsk
with fixing flags, ...QDir
What should I do?
Try
RemoveDirectoryW(L"\\\\?\\C:\\full\\path\\to\\dir..");
Explanation: besides enabling the long path handling as documented, the \\?\
prefix bypasses Win32 path processing, passing the path directly to NT API, so it would go directly to NT kernel.
Make sure you use RemoveDirectoryW
, not RemoveDirectoryA
, a fully qualified path, and backwards slashes '\\'
(not /
). Due to C++ esaping in string literals, \\?\C:\path
becomes "\\\\?\\C:\\path"
.