_marco_ 0 Posted July 23, 2007 Report Share Posted July 23, 2007 Olá Preciso de executar o seguinte código, mas não está a funcionar nao sei porquê? Runtime rt = Runtime.getRuntime(); Process proc = rt.exec("D:\\Java\\Interface\\teqc.exe "+fich+"> temp.rnx"); Em que : teqc.exe ->comando a ser executado fich-> nome do ficheiro temp.rnx-> ficheiro para o qual é escrito Alguém me pode ajudar? Cumprimentos, Marco Link to post Share on other sites
Hipnoted 3 Posted July 23, 2007 Report Share Posted July 23, 2007 Vê se isto te ajuda: http://www.portugal-a-programar.pt/index.php?showtopic=6591 "Nunca discutas com um idiota. Eles arrastam-te até ao seu nível e depois ganham-te em experiência" Link to post Share on other sites
_marco_ 0 Posted July 23, 2007 Author Report Share Posted July 23, 2007 Sinceramente não me entendo com aquele código... O k estou a tentar fazer é executar um comando no DOS sobre um ficheiro e ao mesmo tempo tento escrever para um ficheiro. Link to post Share on other sites
_marco_ 0 Posted July 23, 2007 Author Report Share Posted July 23, 2007 Agora até estou a fazer de outra maneira: FileWriter writer = new FileWriter(new File("teste")); writer.write("D:\\Java\\InterfaceTeqc\\teqc "+fich+" > temp.rnx"); writer.flush(); writer.close(); Runtime.getRuntime().exec("./teste"); Mas assim da-me um erro: CreateProcess: ./teste error=193 ??? Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now