call Process.waitFor() -- this blocks until the process finishes and then try looking at the output after calling waitFor()
Rahul wrote: > -lothar > I did that, there is no debugout neither a new directory is made when > i execute from gwt. If i execute it manually from the dos prompt I am > getting the desired output. > > -Paul > I tired calling your way also, nothing happens when im running a bat > file,no ouput is generated. but when i tired opening the notepad it > opens. There is no output in Process.getErrorStream() > > I believe that as lothar said, the Finalizer is killing my batch so > fast that it never gets executed > so how can i slow down the finalizer that my batch executes? > > > On Aug 12, 11:59 am, Paul Robinson <[email protected]> wrote: > >> It may be that some useful output is going to the process's standard >> output or standard error. You can get at that by calling >> Process.getInputStream() andProcess.getErrorStream() >> >> Rahul wrote: >> >>> Hi, >>> Thanks a lot for your replies >>> >>> -lothar, its not leading to an IO exception, I checked it >>> - paul, i could not follow what you were trying to say >>> >>> when changed to cmd to notepad, the notepad opens >>> >>> when I read more about the exec command it says that it does not open >>> the command prompt(the black window), but it still executes the batch >>> job >>> so i am using the string : >>> try { >>> Runtime.getRuntime().exec("cmd.exe /C start >>> test.bat"); >>> } catch (IOException e) { >>> // TODO Auto-generated catch block >>> e.printStackTrace(); >>> } >>> >>> test.bat makes a hello directory in the specified location, but its >>> not working from this code. >>> if recognizes that its executint test.bat but theres no output >>> >>> when im runnning test.bat from dos prompt the desired output is >>> obtained but not from this >>> >>> On Aug 12, 11:15 am, Paul Robinson <[email protected]> wrote: >>> >>>> Try: >>>> >>>> Process p = Runtime.getRuntime().exec("cmd.exe"); >>>> InputStream is = p.getInputStream(); >>>> >>>> and then look at what you can read from the input stream >>>> >>>> Rahul wrote: >>>> >>>>> Hi, >>>>> I want to execute dos commands from gwt. Reading from this forum I >>>>> have to invoke the call from server not from the client. >>>>> This is my server side code: >>>>> >>>>> public String greetServer() >>>>> { >>>>> try { >>>>> Runtime.getRuntime().exec("cmd.exe"); >>>>> } catch (IOException e) { >>>>> // TODO Auto-generated catch block >>>>> e.printStackTrace(); >>>>> } >>>>> return "Hello"; >>>>> >>>>> } >>>>> >>>>> I am getting success at the client side that it was executed properly, >>>>> but I have one question: should the dos prompt window open when i >>>>> execute this program?? i tired putting cmd,cmd.exe but still the dos >>>>> prompt doesnt open >>>>> can anyone tell me what should i do ? >>>>> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
