Shell dos command

I am trying to shell out a dos command and it doesn't work. I get no error message. The command is supposed to create a text file, and the file doesn't get created. Has anybody tried to do this?dos example:date /t > c:\test.txt

I think you need two >>'s, and no space between the >> and the filespec...<br><br>COPY r:\*.RUL x:\ >>flash_BATCH.LOG<br><br>HTH,<br><br>JM

Similar Messages

  • 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.

  • How to execute dos command in Java program?

    In Perl, it has System(command) to call dos command.
    Does java have this thing?
    or any other way to execute dos command in java program?
    Because i must call javacto compile a file when the user inputed a java file name.

    Look in the Runtime class, it is implemented using the Singleton design pattern so you have to use the static method getRuntime to get its only instance, on that instance you can invoke methods like
    exec(String command) that will execute that command in a dos shell.
    Regards,
    Gerrit.

  • 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.

  • Executing a dos command from java in windows nt

    i need to execute the
    " net send"
    command from the command line in windows nt, from within my java program... is there any way that i can execute cmommands in the dos command shell? or rather, does anybody know a way i can send a message ( in windows ) from java, from one computer to another over the lan?? I cannot have a java programming running on all the other computers, so i cannot make my program serve, it must just send the messges using a lan command....
    (the net send command just sends a message in the form of a pop up box on the receiver's screeen)
    thanks a bunch guys!!!
    Thanks a bunch guys!!!!

    you can do that with exec() in Runtime.
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(command here);but before you do that you need to read this:
    http://www.javaworld.com/jw-12-2000/jw-1229-traps.html
    hth
    partha

  • DOS Commands

    Is there any way I can execute DOS commands such as COPY, MOVE, etc. in Java Program?

    Runtime.exec("cmd.exe /C copy c:\\\\1.txt c:\\\\2.txt");
    substitude cmd.exe for approporate shell for your platform.

  • How to call dos commands through HTMLDB buttons

    HI,
    How do i call DOS commands through HTMLDB buttons, or on any process?
    can anyone help me on this?
    THANKS!
    BROKEN

    This article explains how to execute shell commands from whitin pl/sql using java (in the database).
    http://www.oracle-base.com/articles/8i/ShellCommandsFromPLSQL.php
    It is for Oracle8i but should still work. This still looks like a good way to go.
    ~Dietmar.

  • Native dos commands?

    When I try a command like:
    Process p = myruntime.exec("javac *.java");
    it works fine.
    However if I try something like:
    Process p = myruntime.exec("cd..");
    Process p = myruntime.exec("c:\\javac *.java");
    it doesn't work and I get an exception. Now it said in the API and some windows/dos commands won't work. The question is how do I do simple dos commands then, is there an alternative? I would specially like to know how to do a "<dir>javac *.java" as I would like to make an method which compiles java files wherever they may be.
    I am new to Process/Runtime/etc and would like to learn as much as I can about them. All help appreciated!

    >
    I am new to Process/Runtime/etc and would like to
    learn as much as I can about them. All help
    appreciated!You need to understand what a 'shell' is.
    A shell is a program. Just like Windows Word is a program.
    In windows the name of the shell program is 'cmd.exe' or 'command.com'. (For purposes of this discussion .com is the same as .exe.) These two programs are usually refered to by the short hand notation 'cmd' and 'command'
    Runtime.exec() runs programs. So in can run Windows Word. And it can run a shell.
    The command 'cd' is a command that the cmd/command understand. Note that cd is not a program.
    So to run 'cd' you need to run the program that understands it.
    Typically you would do it like this...
    Runtime.exec("command /C cd")
    Note that this does the following:
    -Starts a shell
    -Runs the command.
    In your question you might end up trying the following
    Runtime.exec("command /C cd ..")
    That will run. However it is pointless. You are changing the current directory inside of a shell. It affects only that shell and no others. So if you try to run a command after it in java it will have no impact.
    Additionally note that .bat files are not .exe files. They only run inside a shell as well.
    You might want to purchase "Windows NT Shell Scripting" by Tim Hill. This book has nothing to do with java but it does explain the dos shell script language. It might not be appropriate for your OS but it is the closest thing I have found that really covers dos shell scripting. If you are lucky you might find something different but there won't be many books on the subject.

  • Execute dos commands through java

    Hi,
    Im trying to execute dos commands through java like
              try {
                   java.lang.Runtime.getRuntime().exec("cmd /c cls");
              }catch(IOException e){
                   System.out.println(e.getMessage());
              }Not sure if its possible? however
    open notepad would work
              try {
                   java.lang.Runtime.getRuntime().exec("notepad");
              }catch(IOException e){
                   System.out.println(e.getMessage());
              }Im trying to execute a cls commands to clear screen but without luck.

    The question is, which shell do you want to clear?
    I don't really know, but it could be that Runtime.exec executes its command in a new shell window...

  • DOS commands within ABAP

    Please tell me how to execute DOS commands from within ABAP.

    1.create your shell script your_shell_script.sh:
    src=$1
    dst=$2
    mv -f $src $dst
    2. Create your command Z_YOUR_COMMAND using SM69:
    - Operating system command: /bin/sh (the path to your shell interpretator)
    - Parameters for operating system command:
    /home/sap/bin/your_shell_script.sh (the path to your shell script)
    - Set "Additional parameters allowed" checkbox
    3. Call your command from ABAP:
    data:
    param type sxpgcolist-parameters.
    status type extcmdexex-status,
    exitcode type extcmdexex-exitcode,
    it_log type table of btcxpm.
    p_src = '/common/home/edw/parsekb/b2/*'.
    p_dst = '/common/home/edw/parsekb/b1'.
    concatenate p_src p_dst into param separated by space.
    CALL FUNCTION 'SXPG_CALL_SYSTEM'
    EXPORTING
    COMMANDNAME = 'Z_YOUR_COMMAND'
    ADDITIONAL_PARAMETERS = param
    IMPORTING
    STATUS = status
    EXITCODE = exitcode
    TABLES
    EXEC_PROTOCOL = it_log
    EXCEPTIONS
    NO_PERMISSION = 1
    COMMAND_NOT_FOUND = 2
    PARAMETERS_TOO_LONG = 3
    SECURITY_RISK = 4
    WRONG_CHECK_CALL_INTERFACE = 5
    PROGRAM_START_ERROR = 6
    PROGRAM_TERMINATION_ERROR = 7
    X_ERROR = 8
    PARAMETER_EXPECTED = 9
    TOO_MANY_PARAMETERS = 10
    ILLEGAL_COMMAND = 11
    OTHERS = 99.
    if sy-subrc <> 0.
    *TODO: add your error handling logic
    endif.

  • 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

  • Hyperlinks from my MSWord files suddenly don't work because "/FirefoxHTML\Shell\Open\Command" has somehow been added to the end of each URL.

    When I click to open the hyperlink in my Word file, the message I get in Firefox is "The requested URL /submissions.htmlFirefoxHTML\Shell\Open\Command was not found on this server." When I delete that portion of the URL, the website opens fine. What can I do to make the hyperlinks work properly?

    Thanks for the suggestion. I tried it, but it didn't work. The link information is written correctly on the MSWord page. But when I click on it and the Firefox tab opens, the page can't be found because "FirefoxHTML\Shell\Open\Command" has been added to the end of each URL. Might it help if I reset Firefox?

  • 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?

  • Tcsh shell "alias" command seems to be truncating file names

    Terminal Utility: As a Unix geek, on trying to port a large # of tcsh shell scripts to MacOSX (10.5.6), I have found a strange compatibility issue with the tcsh script "alias" command. After entering tcsh sub-shell from bash (by typing tcsh at the bash prompt, or by setting tcsh as the default shell), and defining the alias "surf_run" by sourcing a script containing the the line:
    alias surf_run 'source /Users/username/SgiNew/molsurf/csh/radix.csh'
    subsequent use of the "surf_run" alias (typing surf_run at the tcsh command prompt) seems to cause the system to truncate the name of the file to about 20 characters. The radix.csh file is actually present at the defined path, but the system seems to be truncating the file name to the last 16 letters or so in this case, and thus returns the following error message:
    : No such file or directory.rf/csh/radix.csh
    as if it is looking for a file rf/csh/radix.csh (which is not there, because the filename has been truncated)
    The number of characters retained actually varies from case to case. Another similarly obtained error message had 30 characters retained in the file name:
    : No such file or directory.rtoz/rtoz/rxtst/unix/login.csh
    Q: Is there any system parameter or environment variable that I can modify that will allow the tcsh shell alias command to recognize properly file paths with large numbers of characters?

    I cannot reproduce this error. A long alias string works fine for me. But the error messages -- as you reproduce them here -- do not look like the string is truncated. It looks like the "No such file or directory" message is being written on top of the string. Like maybe a new line is being swallowed somewhere.
    I suggest taking further inquiries to the Unix forum, under "Mac OS X Technologies".
    [http://discussions.apple.com/forum.jspa?forumID=735]

  • 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.

Maybe you are looking for

  • Can Apple TV work stand alone once loaded with files?

    My video library is at my home, attached to a quite firmly planted Dual 2GHz G5. We have an HD compatible TV at a vacation home, and I'd like to load up an Apple TV from the iTunes library at my home, then move the device to the vacation home. There'

  • Program name starting with " ! "

    Hi ABAPers ! For some unknown reasons, while working on the development of a custom program called "ZVER0221_V2", at some point in my development, the Workbench stared asking me ( almost everytime I save a program and/or and include related to this m

  • Transport landscape problem (cannot change the object)

    Hi All, I have problem to change my object in the integration repository. Initially, i only have 1 XI server (dev and prod), until certain level that i have to add additional server for development. So i just install new xi in new box (fresh). and ex

  • Unzipping core Files

    Im trying to install Java but it keeps telling me that there is a problem unzipping core files. So I tried to change destination but its still not working. Can somebody please try help me :)

  • Is there an iPhone 4 S group or forum?

    I am looking for a email or texting group that I can follow and interact with about iPhone 4S