Escaping special characters in cmd

后端 未结 2 1432
花落未央
花落未央 2020-12-01 18:27

I have a Windows .bat script in which I try to run a command with password in parameter. The password I want to be able to use is ~!@#$%^&*()_+|-=\\][{}\';:\"/.>

相关标签:
2条回答
  • 2020-12-01 18:51

    Give this a try, but if runme.exe's argument parser requires quotes as string encapsulators for passwords, the it's not going to work. If you need to have a quote in your password, then runme.exe needs to provide a way to escape it!

    runme.exe /password:~!@#$%%^^^&*()_+^|-=\][{}';:"/.>?,<
    
    0 讨论(0)
  • 2020-12-01 19:02

    Double the quote in the password and make sure the complete password is enclosed in quotes as well:

    runme.exe /password:"~!@#$%%^^^&*()_+^|-=\][{}';:""/.>?,<"
    
    0 讨论(0)
提交回复
热议问题