Windows命令行上的引号周围的引号 [英] Quotes around quotes on the Windows command line

查看:131
本文介绍了Windows命令行上的引号周围的引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我发现了此Stack  Overflow问题与我想要的内容有关去做;但是,我在目录中包含空格的地方遇到了麻烦.我尝试查看其他一些Stack Overflow问题,但我误解了它们,或者没有一个能真正解决我的问题.我已经看到了将参数作为数组传递并使用%1或某些地址来处理特殊字符的东西,但是还没有任何效果.

So I found this Stack Overflow question which relates to what I would like to do; however, I am having trouble with the directory having spaces within it. I tried looking at several other Stack Overflow questions, but either I misunderstood them, or none have really addressed my problem. I've seen stuff on passing arguments as arrays and using %1 or something to address the special characters, but nothing has worked yet.

我尝试在cmd.exe中输入以下内容:

I tried entering the following into cmd.exe:

schtasks /Create /SC DAILY /TN PythonTask /TR "python "C:\Users\me\stuff   with  spaces  \pythonprogram.py""

但是,引号似乎没有正确的顺序.我希望该命令每天作为python "C:\Users\me\stuff with spaces \pythonprogram.py"输入到cmd.exe.

However, the quotes appear to not be taken in the correct order. I would like the command to be input as python "C:\Users\me\stuff with spaces \pythonprogram.py" to cmd.exe everyday.

如何在Windows命令行上在引号周围使用引号?

How can I use quotes around quotes on the Windows command line?

从下面回答:

在要加引号的参数之前添加反斜杠\.即:

Add a backslash \ before the argument which you are putting in quotes. I.e.:

do_some_command_in_windows_shell_with_this_given_string "run "something.exe""

替换为:

do_some_command_in_windows_shell_with_this_given_string "run \"something.exe""

推荐答案

有根据的猜测:

用反斜杠转义内部引号.

Escape the inner quotes with a backslash.

这篇关于Windows命令行上的引号周围的引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆