# How to remove a file named con? [duplicate]

I have a file named con.php. I tried to remove it through the Windows command line but it returns an error:

Syntax for filename, directory name, or volume label is incorrect.


## marked as duplicate by phuclv, Toto, Twisty Impersonator, bertieb, DavidPostill♦ windows-10 StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Oct 20 '18 at 17:40

• msdos? Do you mean cmd.exe? If so try powershell and / or try cmd again with the filename quoted. – Tyson Oct 20 '18 at 1:48
• no powershell also did not work, return: del: Can not remove item C: \ admin \ admin \ config \ con.php: Path access 'con.php' has been denied. – sNniffer Oct 20 '18 at 1:56
• Did you try quoted? – Tyson Oct 20 '18 at 1:58
• there's no DOS in Windows 10, and the Windows cmd is not DOS – phuclv Oct 20 '18 at 5:31

Assuming the full path is c:\foo\bar\con.php, then
del \\?\c:\foo\bar\con.php

Due to ancient MS-DOS "compatibility" concerns, con is the console, yes even with an extension. This is in a layer above the file system.
The \\?\ prefix suspends DOS-compatible parsing and hands the rest of the spec directly to the file system.