Windows batch file not working

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

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

I also tried these options:

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 the use of "characters" on the command line, I am informed that this parameter is incorrect.

Using "-characters", he tells me that he cannot find the path, even if it exists, including the files in it.

How can i fix this?

+3
source share
1 answer

Use backslash:

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

del- A built-in shell command, and those who traditionally behave a bit strange compared to the rest of the system. While the Windows API does not usually care about which slashes you use, the cmdbuilt-in commands really care.

+6

Source: https://habr.com/ru/post/1752012/


All Articles