I created a file by mistake, and for the life of me, I cannot remove it. If you have 7-Zip installed, you can produce it. If not, it is easy to install.
Here is how the file gets created:
PS C:\temp> mkdir abc
PS C:\temp> cd abc
PS C:\temp\abc> & 'C:\Program Files\7-Zip\7z.exe' a -spf .\DuoWindowsLogon.admx,.\en-us\DuoWindowsLogon.adml
Creating archive: .\DuoWindowsLogon.admx,.\en-us\DuoWindowsLogon.adml
Later, I learned the correct command I should type is:
& 'C:\Program Files\7-Zip\7z.exe' a abc.7z -spf DuoWindowsLogon.admx en-us\DuoWindowsLogon.adml
After realizing the error, I tried to remove the directory erroneously created:
PS C:\temp\abc> ls
d----- 11/15/2020 11:09 PM DuoWindowsLogon.admx,.
PS C:\temp\abc> ls D*
ls : Could not find item C:\temp\abc\DuoWindowsLogon.admx,..
PS C:\temp\abc> ls | rm
rm : Cannot find path 'C:\temp\abc\DuoWindowsLogon.admx,.' because it does not exist.
PS C:\temp\abc> rm *
rm : An object at the specified path C:\temp\abc\DuoWindowsLogon.admx,. does not exist.
PS C:\temp\abc> cd ..
PS C:\temp> rm -recurse abc
rm : Could not find a part of the path 'C:\temp\abc\DuoWindowsLogon.admx,'.
As you see, nothing worked. I also tried the file explorer (GUI), it does not work either. How can I have the directory deleted?
PS:
I tried "del /s" on CMD prompt, it did not produce an error but the file is not deleted:
c:\>del /s c:\temp\abc
c:\temp\abc\*, Are you sure (Y/N)? Y
c:\>dir c:\temp\abc
11/15/2020 11:09 PM <DIR> DuoWindowsLogon.admx,.