Java runtime using cmd commands -


i writing tool simplify launching program needs run in command line. having problem windows 8 , xp need run command c:\program files (x86)\juniper networks\network connect\ncluancher.exe + ....now reason in windows 7 nclauncher found not in windows 8 keep getting error not locate c:\program. or invalid program arguments have been specified.

string version_number = getprogramversion();         string url_location = "\"c:\\program files (x86)\\juniper networks\\network connect "             + version_number + "\\nclauncher" + "\"";         string[] location = {url_location + " -url " + url + " -u "             + user_name + " -p " + pass_word + "  -r s1ad"};         // location of network connect specified.         process pr = runtime.getruntime().exec(location);         bufferedreader input = new bufferedreader(new inputstreamreader(             pr.getinputstream())); 

is there way make more universal xp,win 7 , 8 ? process builder work better trying do.

what found work using short hand command line method , mean typing c:\progra~2

identify os type , use different path each os.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -