cmd命令'DEL'与python中的subprocess.Popen不起作用

我正在优化我的脚本。 我用'ROBOCOPY'和'DEL'等windows命令代替了我的复制和删除功能。 我在subprocess.Popen的帮助下执行这个命令。 'ROBOCOPY'工作正常,但'Del'命令不起作用。

这是我的指示,

subprocess.Popen(["DEL /S /F /Q  D:pathtothefile*.LOG"], shell=True, stdout=subprocess.PIPE)

这个相同的命令(这个完全相同的字符串)在cmd中工作得很好,但它不能在python中工作。 请任何人帮我找到我的错误? 先谢谢你。

链接地址: http://www.djcxy.com/p/42435.html

上一篇: cmd command 'DEL' is not working with subprocess.Popen in python

下一篇: How to remove a lot of folders at once using Python?