Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem running exe file in program files thru java

 
prashant komaragiri
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am involved in an application where i need to run exe file thru java but the problem is if the directory has spaces between it like d:\Progam Files it doesnot run. So while running it only checks d:\program and not d:\program files, my code is Like this :
String sysCommand = new String("cmd /c start Synlook -F SyncXML.xml -A Import");
...
...
Runtime r = Runtime.getRuntime();
Process p = r.exec(sysCommand);
synlook is my exe file and rest are parameters.
prashant
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can reference the directory by it's DOS name (on Windows) where "program files" = "progra~1" (and if you have a new folder call programmitic it would probably be progra~2, etc.).
Sean
 
prashant komaragiri
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sean,
thats true but, this works out fine when i know the directory in which the exe file is going to be installed ,This is an installable application so i don't know where the user is going to install it.Thanks for the response.
Prashant
 
Bill Siggelkow
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could just document that the user should add the directory to the PATH
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic