Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete file with space in name in command prompt

Status
Not open for further replies.

Drakujii

MIS
Jul 4, 2003
80
0
0
CA
Hi,

I've created a batch file that would delete all files in a directory. But when it gets to a file with a space in the name, it gives the error file not found.

Pocket CMD v. 3.0

thanks

Fred

You have only one life, enjoy it !!!
 
Place Quotes (") around the file names, including the extention.

IE:

Delete "this is a file.ext"

and that will delete files with spaces in them. Or you can delete using their 8.3 standard file name by doing this

dir /x to find the 8.3 standard name and just delete using that name instead of the longer name with spaces.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top