deleting filenames with leading and/or trailing blanks

  • Thread starter Thread starter Brian V. Smith
  • Start date Start date
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.

--
 
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 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.
 
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.
 
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.
 
Back
Top