Starting DOS command on a server

Hi all!
I am not sure whether I my problem can be solved in this forum, but I try it, as it seems like a common problem:
I have a server, let's say "live01", which has different programs running, that can be monitored over some commands which can only be executed from a DOS box, on this ("live01") server. This server, also acts as the web server for distributing my new JWS (Java Web Start) application which graphically shows the status of the programs running on the "live01"-server.
My application should be visible to the whole company (that's why I use JWS), although only a few people would have access rights to the "live01"-server, where the monitored programs are actually running.
As you could guess from the lines above, I need to call the DOS command on the "live01"-server from my locally running application (and get the results back).
NOW the PROBLEM: I do not know how to call this DOS commands (on the "live01"-server) from the local PC where the JWS application runs. When I use
Runtime.getRuntime().exec(someCommand);
this is surely executed on the local PC, where I do not have the tools to monitor the programs on the server!
PLEASE HELP!!!!!!!!!!!!!!
thanks
nocomm

Are you only interesting in starting the program or start it and get result from it ?
to start the program, just execute the line:
String file = "";
file = System.getProperty("user.dir")
+ System.getProperty("file.separator")
+ "your_program.exe";
try{Runtime.getRuntime().
exec("rundll32.exe shell32.dll,ShellExec_RunDLL " + file);
catch(Exception g) {
g.printStackTrace();
on your java server...
or is that a problem for you ??

Similar Messages

  • Error 57 in invoking sqlplus command from DOS command prompt in Oracle Serv

    I have a Oracle 11G server which has suddenly shutdown due to power cut-off. Now when I restart the system and trying to connect to database invoking the sqlplus as sysdba from DOS command prompt - I am getting following errors
    C:\Documents and Settings\Administrator>sqlplus "/as sysdba"
    Error 57 initializing SQL*Plus
    Error loading message shared library
    Can anyone help me please ?

    Yes sure!! .. The details of alert logs for today is herewith -
    Thu Feb 28 12:30:02 2013
    kewastUnPackStats(): bad magic 1 (0x0DFE82DA, 0)
    kewastUnPackStats(): bad magic 1 (0x0DFE82DA, 0)
    Thu Feb 28 12:36:02 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:36:19 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m000_5180.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m000_5180.trc:
    ORA-00204: error in reading (block 1, # blocks 1) of control file
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:36:40 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:37:08 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:37:28 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:37:50 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:38:07 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m000_6256.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m000_6256.trc:
    ORA-00204: error in reading (block 1, # blocks 1) of control file
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:38:12 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:38:34 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:38:56 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:39:31 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:39:47 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m001_7628.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:39:49 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m001_7628.trc:
    ORA-00204: error in reading (block 1, # blocks 1) of control file
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:40:10 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:40:31 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_ckpt_3160.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Thu Feb 28 12:40:48 2013
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m002_2748.trc:
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.
    Errors in file d:\app\collbrs\diag\rdbms\collbrs\collbrs\trace\collbrs_m002_2748.trc:
    ORA-00204: error in reading (block 1, # blocks 1) of control file
    ORA-00202: control file: 'D:\APP\COLLBRS\ORADATA\COLLBRS\CONTROL01.CTL'
    ORA-27070: async read/write failed
    OSD-04006: ReadFile() failure, unable to read from file
    O/S-Error: (OS 1117) The request could not be performed because of an I/O device error.

  • How to run stored procedure in DOS command line????

    Hi,
    I want to run a stored procedure in DOS command line?
    (My_Stored_Procedure is the stored procedure that I want to run )
    This is what I did in DOS prompt
    C:\>sqlplus scott/tiger exec lMy_Stored_Procedure <Return>
    Obviously it is NOT working. Please send me the correct way to fix this.
    Thanks so much in advance for helping.
    Cuong

    Billy  Verreynne  wrote:
    BluShadow wrote:
    True Billy, but even Windows hasn't completely got away from using the "DOS" word...Yeah - the command line/shell environment is based on that of the old DOS command interpreter. But Microsoft does not make the mistake of call it DOS.
    In fact, with earlier versions of Windows NT, a 16bit DOS real-mode virtual machine was supported. This was very kewl.
    Running a large BBS with multiple nodes back then required a DOS machine per node, an IPX network, and a Novell file server.Novell Netwars. ;)
    Ahhhh! good old DOS... so many good programs written at that low level, outside the Windoze environment.Yeah.. cut my teeth on writing code for DOS. Still have all my old BIOS and assembler manuals for it. Wrote my own screen s/w (write to a buffer and then move it into the video buffer, instead of writing char wise to the video buffer via interrupts), mucking about with my own concurrent threading model (using very simplistic cooperative multitasking) and so on. Heck, wrote tons of s/w on DOS... :-)Yeah I've still got a copy of my old machine code programs for writing to buffers and screen memory switching for smooth animation. Run them nowadays and they run like sh!t off a shovel. And all my old coursework including writing an interpreted language and multi-window (dos based windows) editor, parser and the code to execute the language and display the output. Oooo, and so much other stuff.
    Awesome back then as you got really intimate with the o/s and hardware. This is sorely lacking today in environments like Java. And I think the reason why so much code written today is less than optimal - to put it kindly.Exactly. Started for me on the Sinclair zx81 (writing Basic), then the Sinclair Spectrum (Basic and Assembly), then Sinclair QL (yes I really had one!) and then the BBC Master 128K (where I got to writing my own rom filing system and creating my own eproms, to integrate with the word processor for additional printing features etc. as well as storing games on rom for speedy loading - and I still have it and it still works!)
    It's that level of working with the underlying memory and assembly language that gives you the understanding of how values are passed between code using the stack and registers, and how memory allocation and referencing is done etc. As you say... it's missed in a lot of todays teaching, which just seems too high level and misses the basic concepts of things such as datatypes and why they are different. I bet half the modern programmers wouldn't have a clue how to do multiplication or division of binary numbers using the carry flag.

  • Abobe 9: Printing a PDF file using a DOS command

    I have Adobe 9.4.0 on a server and would like to print PDF files using a DOS command. The DOS command we are using is:
    start Acrord32.exe /T/S/h/O "C:\BO_Archival_Code_Deployment\Print\TINF018_C.pdf" "Lexmark T644 PS3 - 10.192.36.126"
    With this, we are able to print only page 1 of the PDF file. The other pages remain unprinted. This means there is no issue related to printer configuration, firewalls, etc.
    Other observations:
    1) When we print the file manually after opening it in Adobe 9.4.0, all pages are printed.
    2) We found that the above command provides different results with Adobe 8.2.6 i.e. with the DOS command, all pages are printed while using Adobe 8.
    We are trying to automate some tasks for which we require the PDF files to be printed automatically through a DOS command. We are being advised to use Adobe 9 as technical support for Adobe 8 is likely to be withdrawn soon.
    Please can you help.

    Sorry. This is a forum for Adobe Connect issues not PDF issues. Please locate the correct forum so your question can be addressed properly there.

  • Execute MS-DOS command in Transaction

    Hello,
    I am copying encrypted files from the ftp server with the action: FTP Input.
    This works fine, but after this action i want that it executes a dos command from xMII to decrypt the files. I have a statement like this:
    raes-1.exe -d %TEST% DELFOR_20080507095802864.aes DELFOR_20080507095802864.xml
    I already tried some things, but i do not use a htm page or javascript. I want only the functions in a transaction and schedule this transaction. It has to look every day if their are files. Copy and decrypt them.
    When i executed through windows --> start --> run it works, so somehow it should also be possible to execute the command through MII.
    Kind regards,
    Nick
    Edited by: N. Meuter on Oct 17, 2008 3:38 PM

    I have developed it on my own system and uploaded it through the xmii menu custom action blocks.
    Now i deleted the action block and wanted to upload it again. But it did deployed directly. Where should i clear java? On my own computer or server?
    My java console on local machine says this:
    JNLP JREDesc in Component ignored: null
    JNLP JREDesc in Component ignored: null
    JNLP JREDesc in Component ignored: null
    ConsoleLogger::Creating NEW instance...
    WARN - Could Not Load Muffins, Using Defaults: http://smnlxmii2:50000/XMII/CMSLogicEditor/LookAndFeel
    <<< frog.jar: version 5.4.6  02/01/06  sap.theme: Tradeshow >>>
    Unable to localize label 'null', null
    Unable to localize label 'null', null

  • Running a dos command

    Hi guys,
    I've created a prog that runs as a server and you can telnet into and give it commands to execute programs on the remote computer. All using runtime.exec().
    Just wondering if anyone knows how i can send a dos command to it such as COPY \\192.168.1.2\temp \\192.168.1.3\temp.
    If i use "cmd.exe /c start cmd.exe" then it opens the window its just i cant remember how to send the dos command to it, as i actually wrote the program several months ago.
    Cheers for any help
    Andy

    One way is to put the dos commands inside a batch file and 'exe' the batch file. Not sure if you also mean you don't want to see the new dos window ( use min to minimize that new window for that ), or not.

  • Running forms from DOS command prompt

    how do u run forms (*.fmx) from the DOS command prompt?
    TY in advance

    hi,
    In Developer 10g, you can not run the form in client/server mode. Your case is a form of client/server mode operation.
    To run froms in Oracle 10g, your must run on the web, that is, you must have http server installed.
    If you have successfully installed Oracle Developer Suite 10g, it has automatically installed and configured a working http server.
    all you have to do is to modify some config files in <devsuitehome>/forms90/server directory folder namely:
    1. default.env where you add your path for your library files as in of your library files
    (*.pll)
    2. formsweb.cfg where set the workingDirectory parameter to point to the location
    of your forms (*.fmx) files.
    You have also to install Jinitiator by executing the file <devsuitehome>/jinit/jinit.exe.
    Start your OC4J instance
    then you can run the form from form builder.
    regards,
    Mike

  • Is it possible to call ms-dos command in abap program?

    Hi,
    is it possible to call ms-dos command in abap program?
    Thanks.

    Hi Cemil,
    You probably have your answer here:
    [Re: DOS/Windows command in app server;
    You create your external command with SM69 (you can test it with SM49).
    Then you call this command with function module "SXPG_COMMAND_EXECUTE".
    (See function group SXPT for all the calls to external commands).
    Regards,
    Thomas

  • How to run multiple DOS commands from a single Webutil Client_Host session?

    Hello all,
    I have a requirement where I need to create an interface with SVN from Forms for basic checkin-checkout of files.
    So, I've been trying to use webutil client_host to open a command line session and issue svn commands.
    For svn, sometimes I need to give multiple commands like change to a particular directory and then run an svn command.
    But client_host takes in only one command at a time and I'm unable to issue a series of DOS commands to perform
    a particular task.
    Is there a way to do this?
    Pls suggest.
    Regards,
    Sam

    First your original question... You can put more than one DOS command on a single line, simply separate each command with an ampersand (&). For example:
    mkdir c:\abc & cd abc & dir*
    Regarding your concerns about performance, well that would depend on exactly what you mean. Using CLIENT_HOST (or HOST on the server) simply opens a shell (DOS in this case) then passes your command to it. The performance of performing this action really isn't measurable. Basically you are just pressing a button and you should get a near immediate action. As for the performance of executing each command, that has nothing to do with Forms. Once the command is passed to the shell, the rest is a function of the shell and whatever command you passed.
    Having said that, if you were to write something sloppy like a loop (in pl/sql) which called CLIENT_HOST lots of times repeatedly, then yes there would be a performance problem because the pushing of the button will cause an exchange to and from the server and each cycle in the loop will do the same.
    So the answer to how performance is impacted will depend on what exactly you need to accomplish. If it is a single call to CLIENT_HOST, this should be fine.

  • Is there a way to run dos commands on onther system?

    Hi I have connected to a port of another system where windows is the operating system. So can I run dos commands on the other system through that network connection from my computer?

    I'm not sure what you mean by "connected to a port of another system" . Which port using what software to which server?

  • Execute DOS command in current window!

    All:
    Here is my code :
    import java.io.*;
    public class BuildScript {
    public static void main ( String[] args ) {
    String[] command = {"C:\\winnt\\system32\\cmd.exe", "cls"};
    try {
    Process process = Runtime.getRuntime().exec ( command );
    process.waitFor();
    } catch ( InterruptedException e ) {
    e.printStackTrace();
    System.exit(-1);
    } catch ( IOException e ) {
    e.printStackTrace();
    System.exit(-1);
    System.out.println ( "DONE!" );
    I just want to exeute some simple DOS command from Java application. And then I run this code, it hangs there for ever. I comments out "process.waitFor()", then it print out the "DONE" however it seems that it just open another console and clear that one and exit. For the main console I start my code, nothing happened.
    Can anyone help me out how to execute the dos command in current console window.
    Thanks

    Can anyone help me out how to execute the dos command in current console window.Sorry to say but there is no way to do that.
    The best way to clear the screen is to print a few hundred newlines.
    Trust me, this is a frequently asked question.

  • Is it possible to run dos-command's in java?

    I have a small security problem. I have a dos-based java prog. with login at the start og the program, but I have problems hiding the password. I have managed to hide the password when it is typed, but when you press enter and get to the next menu, it is only to press the up-key, and dos recover the last typed sentence. (The password...) I have been able to fine the dos-command "doskey /reinstall", which will clear the memory, but I haven't been able to implemet this in my java-prog.
    Any tips/trics are appreciated.

    I have a small security problem. I have a dos-based
    java prog. with login at the start og the program, but
    I have problems hiding the password. I have managed to
    hide the password when it is typed, but when you press
    enter and get to the next menu, it is only to press
    the up-key, and dos recover the last typed sentence.
    (The password...) I have been able to fine the
    dos-command "doskey /reinstall", which will clear the
    memory, but I haven't been able to implemet this in my
    java-prog.
    I doubt that calling that in your program would help.
    doskey is specific to the process. Running it by any means in java means that a new process will exist. You can verify this by open two console windows and running doskey in both. Nothing that you do in one will be reflected in the other.
    I don't think your problem is a program problem. That means that it should not be solved by software but rather by management. For example you certainly wouldn't expect your program to make sure that someone wasn't standing behind the user when they typed their password right? And what if someone installs a key grabber on the computer? In that case any program, yours included, would have all the key presses logged to a file.
    Alternatively if you might be able to solve it with one of the following...
    - Recode the application to use a GUI. If there is no console the doskey isn't going to get anything.
    - Write some JNI that bypasses the java input handling. If you handle the input directly then you can turn off echo
    - Inspect the java source code for the VM. There might be a hidden method to turn echo off. Alternatively you can find the code responsible for this, modify them, and use them with the bootclass option to replace the ones in the VM. This solution is not distributable. And it might not be possible solely using java.

  • When Starting OC4J, why the report server doesn't start automatically? !!

    Dear All,
    I have DS 10g on my system and I start the OC4J when I have to run either forms or reports.
    But when I attend to start the do the following command from the form:
    WEB.SHOWDOCUMENT(..../getjobid<jobid>?server=<servername>...), I have an error: FRM-41213: Unable to connect to the report server <servername>.
    I noticed that if I run the following URL:http://<server>:.../reports/rwservlet, it gives me a list of command, but the server still not running..But if I add any command to the above URL like for example "getserverinfo" or "showjobs" then the server is started. Now, and after the command, if we return back and we run the report from the form, the report will run successfully.
    The question WHY??
    Regards,
    Joe
    Message was edited by: Joe
    Joe Farah

    Hello,
    That's the way it works ...
    http://download-uk.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_strt.htm
    2.1.3.1 Starting the In-process Server (Windows and UNIX)
    If you are using Reports Server as an in-process server (the default configuration), sending a run report request starts the in-process server; however, if you are sending a request through a command line, the servlet must be invoked first using either the run report URL or the Web command URL. When you have successfully started the servlet, this also means you have successfully started the in-process server.
    If you use "Oracle Application Server", the "in-process" reports server will be started automatically by opmn ...
    Regards

  • How can i make the results of dos command print to text area in a gui????

    I need to get the results from a command line application to print in a text area located in a gui... i have the following code written, which should run the command... if run from a dos window, the command prints the list of what's in a jar file to the screen.... i want that info that is printed to go in a text area which i have named textBox which is global to the program.. i know textBox.appends() is what i should use but how do i retrieve the info from the dos window to put in the appends method?
    The code is below for the method..
    Thanks,
    DH
         /*     Runs the DOS Command for listing a JAR File     */
         public void jarList ( ) // Needs To Be Fixed!!
              listFieldText = listField.getText();
              String command;      
              command = "jar tf " + listFieldText;
              System.out.println(command);
              Runtime rt = Runtime.getRuntime();
              try
                   Process child = rt.exec(command);
                   child.waitFor();
                   System.out.println("Process exit code is: " + child.exitValue());
              catch(IOException e)
                   System.err.println("IOException starting process!");
              catch(InterruptedException e)
                   System.err.println("Interrupted waiting for process!");
    }

    Replace child.waitFor()with:          BufferedReader br=new BufferedReader(new InputStreamReader(child.getInputStream()));
              String s="";
                    while((s=br.readLine())!=null) {
                        textbox.append(s);
                    }Mark

  • Old DOS commands that prompt y/n

    My organization assigns every employee a personal drive on a network share. For some reason, be it old software installs or bad workstation backups, many users now have a Windows directory on their network share that we'd like to get rid of. Easy to script,
    right? I already did that:
    $userfolders = gci \\server1\users\*\
    $count1 = 0
    foreach ($userfolder in $userfolders){
    $windowsfolders = gci $userfolder.FullName -directory | where-object { $_.name -like "windows" }
    foreach ($windowsfolder in $windowsfolders){
    $fullname = $windowsfolder.fullname
    remove-item $fullname -recurse -force
    $count1++
    write-host "$count1 Windows folders removed"
    and it was successful on 90% of the user drives, but quite a few users have old IE temp files with more than enough characters in their name to be over 260 characters and Powershell won't remove those. CMD using rd /S will, but that prompts you "Are
    you sure? Y/N"
    So how do I pass a "y" to a CMD command in Powershell?
    [email protected]

    For the record, passing old DOS commands in Powershell is a PITA. I ended up having to do this, because the "RD" command can't use a UNC:
    $userfolders = gci \\pfil9903\users\*\
    foreach ($userfolder in $userfolders){
    $windowsfolders = gci $userfolder.FullName -directory | where-object { $_.name -like "windows" }
    foreach ($windowsfolder in $windowsfolders){
    $fullname = $windowsfolder.fullname
    #remove-item $fullname -recurse -force
    CMD /C "net use /delete z:"
    CMD /C "net use z: $fullname"
    CMD /C "rd /S /q z:\windows"
    CMD /C "net use /delete z:"
    But now I'm getting errors about z: still being in use:
    CMD : The system cannot find the file specified.
    At \\server\users\user1\Powershell\Users Windows Directory Removal.ps1:10 char:9
    + CMD /C "rd /S /q z:\windows"
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (The system cann...file specified.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
    There are open files and/or incomplete directory searches pending on the connection to z:.
    Any ideas?
    [email protected]

Maybe you are looking for