Space in filename

June 26, 2009 at 09:35:42
Specs: Windows server 2003
Hi,
I'm running a batch file to delete some old log files in the "Microsoft SQL Server" folder. It works fine when I test it in a short path like "C:\testfolder", but if I use the path with a space in the folder name like this "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\LOG200", it will not delete the file. The message showing:"The system cannot find the file in C:|Program ". That means the program ignored the path after the space if the folder name. So how can I work with the space in the path of the file in batch program?

Thanks.


See More: Space in filename

Report •


#1
June 26, 2009 at 12:04:38
Embrace the path/filename between double quotes ("), i.e.

"C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\LOG200"

I'm quite surprised you ignore that rule introduced since Windows 95.

Report •

#2
June 26, 2009 at 14:47:37
Yes, the path\filename is embraced in the double quotes as I said in the comment. But it is ignored by the batch processing.

Thanks.


Report •

#3
June 26, 2009 at 17:52:32
Posted here and in DOS. LOL

Neither shows the bat.


=====================================
If at first you don't succeed, you're about average.

M2


Report •

Related Solutions

#4
July 1, 2009 at 04:39:28
I think WINDOWS had more complex in security than DOS, if you know the method such as New file format that can difference from FAT , FAT32 , HTFS
,I think you may study formating also.

Doing any in DOS is a good thing for batch file programming


Report •

#5
July 1, 2009 at 05:09:27
That clears it right up.


=====================================
If at first you don't succeed, you're about average.

M2


Report •


Ask Question