不同的命令提示符窗口不执行相同的命令 [英] Different Command prompt windows does not executing the same command

查看:231
本文介绍了不同的命令提示符窗口不执行相同的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个命令提示符窗口,如下所示:

I've two command prompt windows as follow,



  1. 管理员:命令提示符


-



  1. 管理员:C:\Windows \System32\cmd.exe - 由C#代码
    (Process.Start)打开


我试图执行svn命令,即考虑 svn update

I'm trying to execute svn command, i.e consider svn update command.

此命令在第一个cmd中成功执行,我手动打开。
但是相同的命令不会在第二个cmd窗口中执行,这是由C#代码打开的。

This command executed successfully in the 1st cmd, which I opened manually. But the same command does not executing in the 2nd cmd window, which is opened by C# code.


错误为svn无法识别为内部或外部
命令

Giving the error as "svn" is not recognized as internal or external command

我想从代码中触发。检查路径变量。
创建一个bat文件来执行命令。

I want this to trigger from code. Checked path variables. Created a bat file to execute commands. The same error remains, executing the bat manually works while from code doesn't.

为什么cmd的行为不同?

Why the cmd acts differently?

推荐答案

你说你检查了%PATH%变量,但是你没有说明你如何检查它,结果是什么。在 nd 命令窗口中运行 echo%PATH%时,会得到什么?

You say that you checked the %PATH% variable, but you didn't say anything about how you checked it and what the result was. What do you get when you run echo %PATH% in the 2nd command window?

给出错误消息,几乎可以肯定的是, svn 可执行文件的路径从您的%PATH% 。尝试以下操作:

Given the error message it's almost certain that the path to the svn executable is missing from your %PATH%. Try the following:

set PATH=%PATH%;C:\path\to\svn\dir
svn update

这篇关于不同的命令提示符窗口不执行相同的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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