I can’t delete a direc­tory called con, prn.

CON is a reserved name, so to delete you must use the UNC,

C:>rd \.<drive letter>:<dir>
exam­ple: “> rd \.c:tempcon”

This can also apply to the prn direc­tory. At boot time, PRN is inter­nally con­fig­ured to direct any com­mu­ni­ca­tion with the PRN device to LPT1 (just some background :) ).

I can­not delete a file named con or nul.

The syn­tax \. does not work with a file named con or nul. In fact, no Win32 tool may delete these files.

A solu­tion is to use non-Win32 tools. For instance, the Resource Kit con­tains POSIX util­i­ties such as rm.exe, which allows to delete these files:
> c:NTReskitposixrm con

Note: the files may have been cre­ated with a tool such as notepad or more, using the streams nota­tion. For instance, type “notepad con:foo” on an NTFS par­ti­tion, or “more < any_file > nul:bar”

There is an eas­ier way, with­out using reskit and non-native sub­sys­tems which is to rename the file then just delete:
C:> ren \.c:nul. file
C:> del file