tags:

views:

37

answers:

1

I am trying to do the following in a batch file on Windows 7:

del "./cfg/config.cfg"
del "./cfg/server_blacklist.txt"

I tried these variations too:

del ./cfg/config.cfg
del ./cfg/server_blacklist.txt

del "cfg/config.cfg"
del "cfg/server_blacklist.txt"

del cfg/config.cfg
del cfg/server_blacklist.txt

Without using the "-characters the command prompt tells me the given parameter is not correct.

With using the "-characters, it's telling me that it can't find the path, even though it's there, including the files in it.

How can I fix this?

+6  A: 

Use backslashes:

del ".\cfg\config.cfg"
...

del is a shell built-in command and those traditionally behave a little weird compared with the rest of the system. While the Windows API usually doesn't care what kind of slashes you use, cmd's built-in commands do care.

Joey
Fixed it, thanks.
Angelo Geels