Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 9-Mar-16 0:19am
Comments
dan!sh 9-Mar-16 5:11am    
Path size limits exist in windows. You need to change the location of your files.
Member 12302635 9-Mar-16 6:00am    
Maybe there's a workaround how to use the shell execute so the command i'm executing knows that it is in that path and directory, so i don't have to include it in the command ?
Richard MacCutchan 9-Mar-16 5:16am    
Show your code and the actual path you are trying to use.
Member 12302635 9-Mar-16 6:02am    
I can paste some code of the situation asap. but the path itself is not actually more than 46chars + filename, but it comes three times in the command

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900