引号在Windows命令行报价 [英] quotes around quotes in windows command line

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

问题描述

所以,我发现这太问题关乎我想做些什么;但是,我有有在其内空间的目录麻烦。我试图寻找其他几个SO问题,但无论是我误解了他们,或者没有真正地解决我的问题。我已经看到了传递参数数组和使用1%或东西,以解决特殊字符的东西,但一切都还没有工作。

So I found this SO 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 SO 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""

然而,引号出现不正确的顺序进行。我想命令输入为蟒蛇C:\\用户\\我\\东西用空格\\ 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 in 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运行something.exe

替换为:

do_some_command_in_windows_shell_with_this_given_string运行\\something.exe

推荐答案

猜测:

逃脱引号内用反斜杠。

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

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