ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Little DOS help --Please

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Little DOS help --Please

    Im copying a file from the IFS to a share on the server...It works but it pops up the DOS window even though I say PAUSE(*NO) on the Iseries side...

    Is there a parm I can use in the DOS copy command to not show the completion window.... 1 file copied???


    Code:
     *                                                                
     *  copy command   X = IFS networkshare                           
     *  copy X:\tst.csv   Z: STRPCCMD PCCMD('dir') PAUSE(*NO)         
     *                                                                
    c                   eval      cmdstring = 'strpccmd PCCMD(' + Q + 
    c                             'copy X:\Processes.csv   Z:' + Q  + 
    c                             ') PAUSE(*NO)'                      
     *                                                                
    c                   eval      cmdlength = %len(%trim(cmdstring))  
    c                   call(e)   'QCMDEXC'                           
    c                   parm                    cmdstring             
    c                   parm                    cmdlength
    thanks
    Jimmy

  • #2
    Re: Little DOS help --Please

    Hi Jimmy,

    Pause parameter is used to specify whether the DOS box should pause (prompt with "Press any key to continue") after it has finished executing the
    command.

    - If the value of PAUSE parameter is (*YES), you get the
    'Press Any Key to Continue' prompt in the DOS window
    once the command completes.

    - If value of PAUSE is (*NO), then the DOS window closes as
    soon as the command completes.

    Hence DOS window appears as long as command in execution

    In STRPCCMD there is no facility to block DOS window.
    Thanks,
    Giri

    Comment


    • #3
      Re: Little DOS help --Please

      Thank you Happy Holidays

      Jamie
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #4
        Re: Little DOS help --Please

        Here's an idea...

        Compile this C code....

        PHP Code:
        #include <windows.h>

        int mainint argcchar *argv[])
        {
           if ( 
        argc != )
           {
              
        printf("Invalid number of arguments.\n");
              return 
        0;
           }

           if ( 
        stricmp(argv[2], "h") == 0
             
        || stricmp(argv[2],"/h") == 0
             
        || stricmp(argv[2],"-h") == )
           {
              
        ShowWindow(FindWindow(0,argv[1]),SW_HIDE);
           }
           else if ( 
        stricmp(argv[2], "s") == 0
                  
        || stricmp(argv[2],"/s") == 0
                  
        || stricmp(argv[2],"-s") == )
           {
              
        ShowWindow(FindWindow(0,argv[1]), SW_SHOW);
           }
           else
              
        printf("Invalid parameter.\n");

           return 
        0;

        ...on windows, the command is "cl ShowWindow.c /link user32.lib" if you have visual studio. If you dont ask someone who does.

        This will give you ShowWindow.exe that you can give a new home to in %systemroot%.

        Then at the top of your batch script do this....

        @title thisisthewindowtohide
        @ShowWindow thisisthewindowtohide /h

        And the window is gone !

        Comment


        • #5
          Re: Little DOS help --Please

          An old way I use to do it is as follows:

          copy x.txt xx.txt > nul

          This gets rid of the copy message.

          Comment


          • #6
            Re: Little DOS help --Please

            Thanks greg.... I will give it a try

            jamie
            All my answers were extracted from the "Big Dummy's Guide to the As400"
            and I take no responsibility for any of them.

            www.code400.com

            Comment


            • #7
              Re: Little DOS help --Please

              Greg is correct "> null" directs stdout to nothing, also "> null 2>&1" will direct both stdout and stderr to nothing. This is better if you really dont care what the result is. The command window will still be visible while the commands are running though.

              Comment

              Working...
              X