I am trying to do the foll开发者_StackOverflowowing 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?
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.
精彩评论