exec



Hi everyone,

I can get this working:

Process p = null;
Runtime r = Runtime.getRuntime();
p = r.exec("EmailMoi.bat");
p.waitFor();

------ EmailMoi.bat"); ----
set >>Email_moi_back.txt
tree.com C:\\ >>Email_moi_back.txt
------
java.io.IOException: CreateProcess: EmailMoi.bat error=2
at java.lang.Win32Process.<init>(Compiled Code)
at java.lang.Runtime.exec(Compiled Code)
at java.lang.Runtime.exec(Runtime.java:122)
at Property.getEnvVars(Compiled Code)
at Property.main(Compiled Code)
--

p = r.exec("cmd.exe /c EmailMoi.bat");


runs without complain but the result are not printed to the file.


Thanks for your attention.

Jean Pierre Daviau
--
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
Processor Radeon7000 0x5159 agp


.



Relevant Pages

  • Re: exec
    ... news: WNOWh.12150$q97.87051@xxxxxxxxxxxxxxxxxxxxxxx ... java.io.IOException: CreateProcess: EmailMoi.bat error=2 ... IntelCeleron CPU 2.00 GHz ... Processor Radeon7000 0x5159 agp ...
    (comp.lang.java.help)
  • FC
    ... Server built: Oct 9 2005 19:16:56 ... IntelCeleron CPU 2.00 GHz ... Processor Radeon7000 0x5159 agp ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: Registering pages
    ... I cant register a web page on my desktop. ... IntelCeleron CPU 2.00 GHz ... Processor Radeon7000 0x5159 agp ...
    (microsoft.public.windows.inetexplorer.ie6.browser)