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
Post a Comment