Always use an explicit path so that the error does not delete the current folder, no matter what it might be at that time.
All visible files silently
del "c:\users\admin\desktop\x\*.*?"
All visible files silently using / q
del /q "c:\users\admin\desktop\x\*.*"
All visible files, including subdirectories, silently
del /s /q "c:\users\admin\desktop\x\*.*"
enter del /? for full details.
source share