deleting filenames with leading and/or trailing blanks

B

Brian V. Smith

We backup a MacIntosh to our Win2k server and some of the directories
and filenames have leading and/or trailing blanks in the names.
The problem is that W2k says it can't find the file no matter the
operation, e.g. renaming or deleting via an explorer window.

I have even tried a cygwin bash shell with backslashes and quotes but the
system says it can't find the files.
I tried running a disk scan but it doesn't find anything wrong with the
files.

Any ideas on how to either rename them or delete them?
Thanks for any help.

--
 
D

Doug Allen [MSFT]

Brian,

You can use the following syntax:

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


--
Doug Allen
Windows 2000 MCSE
Microsoft Enterprise NT4/Win2k/XP/Win2k3 Setup Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
R

Ricardo M. Urbano - W2K/NT4 MVP

Doug Allen said:
Brian,

You can use the following syntax:

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

--
Doug Allen
Windows 2000 MCSE
Microsoft Enterprise NT4/Win2k/XP/Win2k3 Setup Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Doug, isn't it actually:

del "\\.\c:\<path_to_file_that contains a trailing space.txt> "
^

But, perhaps '?' will work too. I've never tried it.
 
D

Doug Allen [MSFT]

I have successfully used the syntax I gave, and it does work. I'm not sure
about the dot.

--
Doug Allen
Windows 2000 MCSE
Microsoft Enterprise NT4/Win2k/XP/Win2k3 Setup Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
R

Ricardo M. Urbano - W2K/NT4 MVP

Doug Allen said:
I have successfully used the syntax I gave, and it does work. I'm not sure
about the dot.

--
Doug Allen
Windows 2000 MCSE
Microsoft Enterprise NT4/Win2k/XP/Win2k3 Setup Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Oh, so then it's both, because I had never seen your syntax used before
and I have always used the '.' syntax.

Thx for the update.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top