[英]Autohotkey escape quotes in string (for Run command arguments)
I'm trying to pass arguments to a windows command via autohotkey, but I haven't been able to successfully escape quotes in the string. 我正在尝试通过autohotkey将参数传递给Windows命令,但无法成功转义字符串中的引号。
I want to do something like: Run, shutdown "/s /c /"MESSAGE/"" 我想做类似的事情:运行,关闭“ / s / c /” MESSAGE /“”
So I run the command: shutdown /s /c "MESSAGE" 所以我运行命令:shutdown / s / c“ MESSAGE”
How do I do this? 我该怎么做呢?
Double up the quotes to escape them. 加倍报价以转义它们。
Run, shutdown "/s /c ""MESSAGE"""
See the EscapeChar documentation for more information. 有关更多信息,请参见EscapeChar文档。
The forward slash is not an escape key so you don't need to escape it, if you have problems put curly braces around it like : shutdown {/}f {/}r {/}t 00 {Enter}
but it should work (and does on my machine) without curly braces. 正斜杠不是转义键,因此,如果遇到问题,则无需转义,例如:
shutdown {/}f {/}r {/}t 00 {Enter}
但它应该起作用(并且在我的计算机上使用)没有大括号。 The quotes can also be done inside curly braces. 引号也可以在花括号内完成。 So:
shutdown /s /c {"}MESSAGE{"}
should work. 因此:
shutdown /s /c {"}MESSAGE{"}
应该可以工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.