长文件路径/命令行无法在shell执行.exe文件中工作 [英] Long filepath / commandline not working in shell executin a .exe file

查看:73
本文介绍了长文件路径/命令行无法在shell执行.exe文件中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当文件路径本身很长时,我得到一个命令行,文件路径超过100个字符。

由于某种原因,我正在处理的convert.exe即使不工作这些路径都没问题。



那么如果我只指定一条路径,我怎样才能本地使用命令行呢?

因为如果我转到命令提示符,我可以运行它指定源和目标名称,而不是完整路径。

示例:

convert.exe file.jpg file.jpg

代码我正在使用(必须使用):

C:\ path \ path \ path \ contvert.exe C:\\ \\ path\path\path file.jpg C:\ path \ path \ path file.jpg



提前感谢任何想法。



SSa



我尝试过:



似乎可以使用更短的路径确定。

我尝试以不同的方式工作,但我发现我必须添加完整路径。

解决方案

你好,



我发现我的Use shell的工作目录有问题执行:



ie



myProcess.StartInfo.WorkingDirectory = ChosenDirName + @\+ CreatedDir + @\;





我只是混淆了我自己的变量。



对不起,如果有任何麻烦,谢谢所有答案!



S


When the file path itself is long, i get a commandline eith a file path over 100 characters long.
For some reason the convert.exe i'm working on doesn't work even if the paths are all Ok.

So how can i use a commandline "locally", if i just specify a path where it is?
Because if i go to command prompt, i can just run it specifying a source and target name, not the full path.
Example:
convert.exe file.jpg file.jpg
In code i'm using (have to use):
C:\path\path\path\convert.exe C:\path\path\path file.jpg C:\path\path\path file.jpg

Thanks in advance for any thoughts.

SSa

What I have tried:

It seems to work with shorter paths ok.
I tried to work differently, but i found i have to add full path.

解决方案

Hello ,

I found i had a problem with the Working directory of the Use shell execute:

i.e.

myProcess.StartInfo.WorkingDirectory = ChosenDirName + @"\" + CreatedDir + @"\";


I just got confuse in my own variables.

Sorry if any bother, and thank to all answers!

S


这篇关于长文件路径/命令行无法在shell执行.exe文件中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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