home *** CD-ROM | disk | FTP | other *** search
/ Dr. CD ROM (Annual Premium Edition) / premium.zip / premium / DOSUTIL1 / INCOMAND.ZIP / SORTDIR.BAT < prev    next >
DOS Batch File  |  1992-08-15  |  610b  |  24 lines

  1. echo Sample batch file for InCommand
  2. rem This is an example of using InCommand utilities in a batch file.
  3.  
  4. IF NOT %1!==! goto OK
  5. echo Usage: SORTDIR dirname [/BYTIME] [/BYSIZE] [/BYEXTENSION]
  6. goto END
  7.  
  8. :OK
  9. rem Create a subdirectory to temporarily hold the files
  10. MOVE %1\*.* %1\~TEMP~.~\ /CREATE
  11. IF ERRORLEVEL 3 goto ERROR
  12. rem Now move the files back, sorting as specified.  /BYNAME is the default.
  13. MOVE %1\~TEMP~.~\*.* %1 %2
  14. IF ERRORLEVEL 3 goto ERROR
  15. ird/nolist %1\~TEMP~.~
  16. echo %1 sorted.
  17. goto END
  18.  
  19. :ERROR
  20. echo SORTDIR failed.  You may have to retrieve files from %1\~TEMP~.~\
  21.  
  22. :END
  23.  
  24.