Windows的开始命令不能执行批处理文件 [英] Windows start command not able to execute batch file

查看:116
本文介绍了Windows的开始命令不能执行批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我执行开始从命令提示符下命令。
命令调用名为批处理文件的 D:\\我的script.cmd 并传递参数参数有一个。下面是我特林执行命令。

I am executing start command from command prompt. Command calls batch file named D:\My script.cmd and passes argument "Argument one". Here is command that I am tring to execute.

   C:\Users\ABCUser>start "D:\My script.cmd" "Argument one"

但得到的错误mesasge为系统无法找到文件参数之一。
我不明白为什么命令正在搜索文件。文件我script.cmd的内容。

but getting error mesasge as The system cannot find the file Argument one. I don't understand why command is searching for file. Contents of file My script.cmd.

@echo off
cls
echo "Hello"
echo %1

我缺少的东西或命令语法有错吗?该命令甚至没有工作的文件名没有空格。

Am I missing something or command syntax is wrong ? This command is not even working for file name without spaces.

推荐答案

这是启动/ cmd.exe的处理一个cmd并与报价参数著名的错误。结果
其原因是,启动使用CMD.EXE / K,开始新的任务。结果
CMD / k和CMD / C的帮助下解释,即在这种情况下,第一个和最后引用被除去。

It's the well known bug of start/cmd.exe handling a cmd and also an argument with quotes.
The cause is, that start uses cmd.exe /k to start the new task.
The help of cmd /k and cmd /c explains, that in this case the first and last quote are removed.

和另外您使用启动命令是错误的。

And additionally you used the start command wrong.

这应该工作,作为呼叫就像一个虚拟苏preSS的报价问题

This should work, as the call works like a dummy to supress the quoting problem

start "Title" call "D:\My script.cmd" "Argument one"

这篇关于Windows的开始命令不能执行批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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