home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Backup / Backup.zip / psnsg601.zip / RXDELTR.CMD < prev    next >
OS/2 REXX Batch file  |  1999-10-05  |  2KB  |  45 lines

  1. /******************************************************************************/
  2. /*                                                                            */
  3. /*      (C) Copyright IBM Corporation 1997.                                   */
  4. /*                                                                            */
  5. /*      DISCLAIMER OF WARRANTIES.  The following [enclosed] code is           */
  6. /*      sample code created by IBM Corporation. This sample code is not       */
  7. /*      part of any standard or IBM product and is provided to you solely     */
  8. /*      for the purpose of assisting you in the development of your           */
  9. /*      applications.  The code is provided "AS IS", without                  */
  10. /*      warranty of any kind.  IBM shall not be liable for any damages        */
  11. /*      arising out of your use of the sample code, even if they have been    */
  12. /*      advised of the possibility of such damages.                           */
  13. /*                                                                            */
  14. /******************************************************************************/
  15.  
  16. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  17. call SysLoadFuncs
  18.  
  19. if 0 = RxFuncQuery( 'SysLoadFuncs' ) then
  20. do
  21.    PathName = strip( arg(1) );
  22.    if  length( PathName ) <> 0 then
  23.    do
  24.       PathName = strip( PathName, , '"');
  25.       CurrPath = Directory();
  26.       NewPath = Directory( PathName );
  27.       if translate( NewPath ) == translate( PathName ) then
  28.       do
  29.          call Directory substr( PathName, 1, 3 );
  30.          call SysFileTree PathName'\*.*', 'file', 'SFO', '*****', '**---'
  31.          do i=1 to file.0
  32.             say "Deletion of file "file.i" returned "SysFileDelete( file.i );
  33.          end
  34.          drop file;
  35.          call SysFileTree PathName'\*.*', 'file', 'SDO', '*****', '**---'
  36.          do i=1 to file.0
  37.             say "Deletion of directory "file.i" returned "SysRmdir( file.i );
  38.          end
  39.          say "Deletion of directory "PathName" returned "SysRmdir( PathName );
  40.       end
  41.       CurrPath = Directory( CurrPath );
  42.    end
  43. end
  44.  
  45.