• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem running exe file in program files thru java

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could just document that the user should add the directory to the PATH
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic