home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 October / pcp156b.iso / handson / files / copyhelp.exe / dosutils / dosutils.txt < prev    next >
Encoding:
Text File  |  1999-07-16  |  4.1 KB  |  115 lines

  1. Five MS-DOS utilities (c) 1992-99 Ian Sharpe, PC Plus Magazine (www.pcplus.co.uk)
  2.  
  3. ===============================================================================
  4. CCD.COM
  5. =======
  6.  
  7. SUMMARY: Quick directory change using abbreviated names
  8.  
  9. EXAMPLE:
  10.  
  11.     CCD \wi sy
  12.  
  13. To get to \windows\system. NOTE - NOT \wi\sy.
  14.  
  15. CCD attempts to find a unique match for each item in the path you provide, using the characters at the start of the name. If it does not find a match it will tell you. If there is more than one possible match it will take the first one it finds. Failing a match, before giving up it tries to find a match away from the beginning of the available names. Take this example:
  16.  
  17.     CCD 8
  18.  
  19. If no directory name began with '8', but one was called PROJECT8, then CCD would choose that as its match.
  20.  
  21. One further feature: CCD by itself changes back to the directory you last used it to escape from. The previous directory information is stored in c:\ccd.txt.
  22.  
  23. CCD does not recognise long filenames - base your abbreviations on the short filenames instead.
  24.  
  25. ===============================================================================
  26. CHECKDAY.EXE
  27. ============
  28.  
  29. SUMMARY: Execute parts of AUTOEXEC.BAT once per day, or once on a certain day of the week.
  30.  
  31. Use Checkday with one of the following parameters: MON TUE WED THU FRI SAT SUN ANY
  32.  
  33. EXAMPLE:
  34.  
  35.     CHECKDAY MON
  36.  
  37. If today is Monday, and CHECKDAY MON hasn't already been executed today, then ERRORLEVEL will be 0. Otherwise ERRORLEVEL is 1, or -1 if an error occurred. ANY matches any day of the week, so you can run something once per day.
  38.  
  39. In the following sample, various messages are displayed with ECHO commands once every Friday, once very Tuesday, once per day, and on every execution. 
  40.  
  41. @ECHO OFF
  42. CHECKDAY TUE
  43. IF ERRORLEVEL 1 GOTO CHECKFRI
  44. ECHO The once on Tuesdays thing
  45.  
  46. :CHECKFRI
  47. CHECKDAY FRI
  48. IF ERRORLEVEL 1 GOTO CHECKANY
  49. ECHO The once on Fridays thing
  50.  
  51. :CHECKANY
  52. CHECKDAY ANY
  53. IF ERRORLEVEL 1 GOTO ALLTHETIME
  54. ECHO The once every day thing
  55.  
  56. :ALLTHETIME
  57. ECHO All the time
  58.  
  59.  
  60. ===============================================================================
  61. DELB.EXE
  62. ========
  63.  
  64. SUMMARY: An alternative for the DEL command that deletes all files EXCEPT the ones you specify.
  65.  
  66. EXAMPLE:
  67.  
  68.     DELB FRED.TXT
  69.  
  70. Deletes all files except FRED.TXT
  71.  
  72.     DELB *.TXT FRED?.*
  73.  
  74. Deletes all files except those ending in .TXT and any file that starts with FRED followed by any one character and any extension.
  75.  
  76. ===============================================================================
  77. FILECULL.EXE
  78. ============
  79.  
  80. SUMMARY: Deletes all files more than a specified number of days old.
  81.  
  82. USAGE:
  83.     FILECULL /D<cull age> <filepsec>
  84.  
  85. Where <cull age>=oldest age, in days, that survives the cull and <filepsec>=file specification to check (path optional)
  86.  
  87. EXAMPLE:
  88.  
  89. FILECULL /D30 C:\COMMS\DOWNLOAD\*.ZIP
  90.  
  91. Deletes all ZIP files in C:\COMMS\DOWNLOAD more then 30 days old
  92.  
  93. ===============================================================================
  94. USERINPT.COM
  95. ============
  96.  
  97. SUMMARY: Use in batch files to get a string from the keyboard and place the result in an environment variable.
  98.  
  99. EXAMPLE:
  100.  
  101.     USERINPT TESTVAR
  102.  
  103. to get user keyboard input into TESTVAR. Maximum string length is 255 characters. WARNING! It is up to you to ensure that the environment has been set to a sufficient size to accommodate this amount of extra information!
  104.  
  105. A secondary use for USERINPT is to pipe the output from another program into an environment variable, for example:
  106.  
  107.     ECHO. | DATE | FIND "Current" | USERINPT TEST
  108.     SET
  109.  
  110. Try it see to what happens. Not in itself very useful, but there are occasions when this facility is valuable. For example, it is becomes easy to build a batch file which can set an environment variable to indicate the version of DOS or Win9x being run, and whether or not the batch file is being run inside a DOS box.
  111.  
  112. ===============================================================================
  113.                                         ENDS
  114. ===============================================================================
  115.