double quote escaping in os.system on windows

前端 未结 4 1464
一整个雨季
一整个雨季 2020-12-19 22:01

I want to escape \'\"\' and all other wild chars in program name and arguments, so I try to double quote them. and I can do this in cmd.exe

C:\\bay\\test\\go         


        
4条回答
  •  自闭症患者
    2020-12-19 22:55

    Furthing google comes this page

    http://ss64.com/nt/syntax-esc.html

    To launch a batch script which itself requires "quotes" 
    CMD /k ""c:\batch files\test.cmd" "Parameter 1 with space" "Parameter2 with space"" 
    

    cmd = '""test.py" "a" "b" "c""' does work!

提交回复
热议问题