Re: Can't delete files that end with period



Neil,

Open a command prompt...
Start | Run | Type: cmd | Click OK|

Type or paste this command and then hit your Enter key...

del "\\?\%userprofile%\desktop\courme.*"

Just ignore the blue hyperlink looking test in the command. Outlook Express
thinks that it is a hyperlink because of the double slashes.

As some explanation: %userprofile% is an environment variable that is the
path to the logged on user's home folder. I.e. the same as C:\Documents and
Settings\Wesley P. Vogel. %userprofile% substitutes when you do not know
the actual path. Even works when you do know the actual path , is also way
shorter.

Warning: The courme.* from above with the asterisk (*) is going to delete
every file on the Desktop that is named courme regardless of what the file
extension(s) is/are.. They do not go to the Recycle Bin, they just go away.

The asterisk is a wild card, it is a substitute for zero or more characters.
The asterisk matches up with any combination of allowable characters.

Not knowing what the file extension(s) is/are the asterisk needs to be used
in place of the actual file name.

This works, I created a file called courme..txt on my Desktop and used the
above command to delete it. I did it twice.

<quote>
Cause 6: The file name includes an invalid name in the Win32 name space
You may not be able to delete a file if the file name includes an invalid
name (for example, the file name has a trailing space or a trailing period
or the file name is made up of a space only). To resolve this issue, use a
tool that uses the appropriate internal syntax to delete the file. You can
use the "\\?\" syntax with some tools to operate on these files, for
example:

del "\\?\c:\path_to_file_that contains a trailing space.txt "

The cause of this issue is similar to Cause 4. However, if you use typical
Win32 syntax to open a file that has trailing spaces or trailing periods in
its name, the trailing spaces or periods are stripped before the actual file
is opened. Therefore, if you have two files in the same folder named
"AFile.txt" and "AFile.txt " (note the space after the file name), if you
try to open the second file by using standard Win32 calls, you open the
first file instead. Similarly, if you have a file whose name is just " " (a
space character) and you try to open it by using standard Win32 calls, you
open the file's parent folder instead. In this situation, if you try to
change security settings on these files, you either may not be able to do
this or you may unexpectedly change the settings on different files. If this
behavior occurs, you may think that you have permission to a file that
actually has a restrictive ACL.
<quote>
http://support.microsoft.com/kb/320081

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In news:15B3C6C3-A636-46C6-9D21-6F8F357BC3C3@xxxxxxxxxxxxx,
Neil <Neil@xxxxxxxxxxxxxxxxxxxxxxxxx> hunted and pecked:
Thanks

I have read this ( This was my reference to not understanding)
I wll read again step by step and let you know.

Many thnx
--
Neil


"Wesley Vogel" wrote:

See...
Cause 6: The file name includes an invalid name in the Win32 name space
here...
You cannot delete a file or a folder on an NTFS file system volume
http://support.microsoft.com/kb/320081

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In news:FA48AB07-5AA9-49C1-A88D-F4201D97CDB5@xxxxxxxxxxxxx,
Neil <Neil@xxxxxxxxxxxxxxxxxxxxxxxxx> hunted and pecked:
Please let this be the correct forum for my question

WinXP Pro sp2

I have a user who saved attachments from hotmail message onto her
desktop. filenames end with a period - eg:.. courme.
there are 5 files named similarly

The file size is 0 bytes
attributes are set to archive

If I try to delete the file i get "file cannot be found message"
If i try to rename or move the file - same message

I know I can rename users local profile and set up a new one but would
like to know how to delete.

I have tried reading similar messages with no luck.
I did read about unc paths - (but did not understand)

Any help appreciated.

--
Neil

.



Relevant Pages

  • How to check if a thread waits for data at the read-end of a pipe?
    ... Win32 and in the Win32 version I need a way to check ... attach a semaphore to a named pipe and I can then use the other API ... My application acts as a GUI command line shell in this regard. ... child's STDIN, STDOUT and STDERR streams in standard documented ways. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: DOS Options
    ... Both MS-DOS and Win32 only ... Windows does appear to have a CommandLineToArgvW function that parses ... the command line. ... compiler vendors are rewriting their runtime to purposely break something ...
    (comp.lang.ada)
  • [Full-Disclosure] Re: Buffer Overflow in ActivePerl ?
    ... > i played around with ActiveState's ActivePerl for Win32, ... > Perl.exe with the following command: ... > I wonder if this bug isnt known?!? ...
    (Full-Disclosure)
  • Re: Preprocessor Directives
    ... a compiler that predefines WIN32 (without ... specified in the command line. ... The conformance of a compiler is highly ...
    (comp.lang.c)
  • Re: system() rc hosed?
    ... >>myprogram. ... In fact, the return code is 255, which seems to translate to ... >>the command line, it works fine. ... > especially if trailing spaces or newlines might be involved. ...
    (comp.lang.perl.misc)