Tech Support > Operating Systems > Windows 2000 > deleting filenames with leading and/or trailing blanks
deleting filenames with leading and/or trailing blanks
Posted by Brian V. Smith on November 4th, 2003


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.

--
---------------------------------------------------------------
Brian V. Smith (bXvXsXmXiXtXh@lbl.gov) (remove the Xs to send me email)
Lawrence Berkeley National Laboratory
I don't speak for LBNL - they don't pay me enough for that.
Check out the xfig site at http://epb.lbl.gov/xfig or http://www.xfig.org

Posted by Doug Allen [MSFT] on November 4th, 2003


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.


"Brian V. Smith" <bvsmith@epb4.lbl.gov> wrote in message
news:bo912j$fbh$1@overload.lbl.gov...


Posted by Ricardo M. Urbano - W2K/NT4 MVP on November 4th, 2003


"Doug Allen [MSFT]" wrote:
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.
--
Ricardo M. Urbano
Microsoft Windows 2000/NT MVP

Posted by Doug Allen [MSFT] on November 5th, 2003


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.


"Ricardo M. Urbano - W2K/NT4 MVP" <rmu1@columbiaSPAM.SUCKSedu> wrote in
message news:3FA836C4.6DE06498@columbiaSPAM.SUCKSedu...


Posted by Ricardo M. Urbano - W2K/NT4 MVP on November 5th, 2003


"Doug Allen [MSFT]" wrote:
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.
--
Ricardo M. Urbano
Microsoft Windows 2000/NT MVP


Similar Posts