home *** CD-ROM | disk | FTP | other *** search
/ Software Recommendations - 1998 Season 1 / DNBCD4.iso / share / dostool / pock51 / DEMO.BAT < prev    next >
Encoding:
DOS Batch File  |  1997-07-26  |  13.5 KB  |  397 lines

  1. use
  2. goto disp
  3.  
  4. :bestfit
  5. echo This is the "Best-fit" format which automatically chooses the display format.
  6. echo In this case /w format is chosen to fit the 80x11 format used by the demo.    
  7. echo.
  8. echo     D /b
  9. echo.
  10. d    /b~.20
  11. echo.
  12. pause
  13. cls
  14. echo This can be modified by "column optimise" (/.k) to limit the No. of columns.
  15. echo In this case the layout is altered to 3 columns which still fits inside 11 rows.
  16. echo.
  17. echo      D /b/.k
  18. echo.
  19. d    /b~.20/.k
  20. echo.
  21. pause
  22. goto disp
  23.  
  24. :subdir
  25. echo This demonstrates some of the subdirectory summary features of PocketD
  26. d    /Yny// /'/This will require creation of temporary subdirectories with files/copied into them. Ok ?'
  27. if not errorlevel 2 goto disp
  28. echo      D N*.BAT D*.BAT /cc ATEMP1         ( command used for copy/create )
  29. echo.
  30. d    n*.bat d*.bat /cc atemp1 
  31. echo.
  32. md atemp2
  33. echo Subdirs ATEMP1 and ATEMP2 created
  34. echo.
  35. pause
  36. cls
  37. echo The following uses /r to include a summary of the contents of subdir ATEMP1
  38. echo and ATEMP2 (restricting summary to just BAT files)
  39. echo.
  40. echo     D /r .bat
  41. echo.
  42. d    /hr2K.28 .bat
  43. echo.
  44. pause
  45. cls
  46. echo The following uses /S and /G to group contents of subdirs (with /w format)
  47. echo.
  48. echo     D /wSG .bat
  49. echo.
  50. d    .\AT* /hwSG~.35+ .bat
  51. echo.
  52. pause
  53. cls
  54. d    /Y// /'//Deleting temporary files.'
  55. echo     D  atemp1 atemp2 /zd        ( command used to delete )
  56. echo.
  57. d    atemp1 atemp2 /Ihzd
  58. echo.
  59. pause
  60. goto disp
  61.  
  62. :tail
  63. echo PocketD offers 19 tailoring options. The following shows four of these:
  64. echo.
  65. echo 1. Unbroken names   2. 1jan91 date format   3. Lowercase   4. Sorting by row
  66. echo.
  67. echo     D /.umlr
  68. echo.
  69. d    /.umlr/2~.28
  70. echo.
  71. pause
  72. goto disp
  73.  
  74. :templ
  75. cls
  76. echo PocketD has a very powerful TEMPLATE facility that can be used for display
  77. echo or execution purposes. It can accept 50 possible parameters, a few shown below.
  78. d    /Y12// /'//@tChoose://@t1. Display output/@t2. Execution//@tESC cancel//@t?'
  79. cls
  80. if errorlevel 2 goto t_exec
  81. if errorlevel 1 goto t_disp
  82. goto main
  83.  
  84. :t_disp
  85. echo The display template can be used in many ways. The simple example at the
  86. echo bottom of the screen simply outputs an X for each matching file/dir.
  87. echo.
  88. echo     D /w
  89. echo.
  90. d    /w
  91. echo.
  92. echo     D [X]
  93. echo.
  94. d    [X]
  95. echo.
  96. pause
  97. cls
  98. echo The template can accept parameters such as $f giving the filename
  99. echo.
  100. echo     D [$f ]
  101. echo.
  102. d    [$f ]
  103. echo.
  104. echo.
  105. echo It can also accept formatted field widths e.g. $16f for padding to width 16
  106. echo.
  107. echo     D [$16f]
  108. echo.
  109. d    [$16f]
  110. echo.
  111. pause
  112. cls
  113. echo $10n gives only the name part without the extension, padded to width 10:
  114. echo.
  115. echo    D [$10n]
  116. echo.
  117. d    [$10n]
  118. echo.
  119. echo.
  120. echo "//" in the template will add a newline:
  121. echo.
  122. echo     D ?????.* [$10n//]
  123. echo.
  124. d    ?????.* [$10n//]
  125. echo.
  126. pause
  127. goto templ
  128.  
  129. :t_exec
  130. echo PocketD can be used to run a template for a selected group of files. For
  131. echo example, the following could be used to move each file extension group to
  132. echo its own archive file. The $e option gives the extension part of the name.
  133. echo (R? below causes PocketD to echo each line without running it. R runs).
  134. echo.
  135. echo     D /e [PKZIP -m $e *.$e]R?
  136. echo.
  137. d    /e [PKZIP -m $e *.$e]R?
  138. echo.
  139. pause
  140. cls
  141. echo PocketD can run multi-line sequences. e.g. To move each file extension
  142. echo group to its own subdir, named by the extension:
  143. echo.
  144. echo     D /e [md $e//copy *.$e $e]R?
  145. D    /e [md $e//copy *.$e $e]R?!E- *.d* *.g* .reg
  146. echo.
  147. pause
  148. cls
  149. echo PocketD can use separate templates for display and execution. This allows
  150. echo the user to browse the display template as a scrolling menu. In the example
  151. echo below $3# provides a file number, $F number of files, $d date, $t time, $s
  152. echo size. The 2nd template starts with [? indicating that it is a display template.
  153. echo The "((" template divider provides a section to appear for the 1st match only.
  154. echo The "Q" option turns the template into a menu (also allowing file viewing etc.).    
  155. echo    D [pkzip -m save $w][?  Choose from://(($3# of $F: $d $t $7s $13w Archive?]RQ
  156. echo.
  157. d    [  Choose from://(($3# of $F: $d $t $7s $13w Archive?]?~.10
  158. echo.
  159. pause
  160. cls
  161. echo PocketD can run alternative templates to give the user the choice of tasks.
  162. echo The example below allows the user to either move a file to an archive AND/OR
  163. echo copy it to drive A:. The user types "1" to execute the 1st template and "2"
  164. echo for the 2nd. This example could have used 2 display templates, giving 4 in all.    
  165. echo  D [pkzip -m save $w][copy $w A:][? $15w (1) Move to Archive (2) Copy to A:]QR
  166. echo.
  167.  
  168. D    [ $15w (1) Move to Archive (2) Copy to A:]?~.10
  169. echo.
  170. echo From this it can be seen that PocketD's templates potentially offer the user a
  171. echo great deal of power for file management. The user is recommended to follow
  172. echo the detailed examples given in the on-line guide, accessed by typing D /??
  173. pause
  174. goto templ
  175.  
  176. :stats
  177. cls
  178. echo PocketD can provide additional information about files and present file
  179. echo data in a number of ways. The following gives a few examples of this.
  180. d    /Y123// /'//@tChoose://@t1. Barchart display/@t2. Execution size and Compression/@t3. Extension summary//@tESC cancel//@t?'
  181. cls
  182. if errorlevel 3 goto exten
  183. if errorlevel 2 goto exec
  184. if errorlevel 1 goto bar
  185. goto main
  186.  
  187. :bar
  188. echo The following chart show the relative size of all files represented as a
  189. echo bar chart. (only 1st 14 files shown).
  190. echo.
  191. echo     D /g
  192. echo.
  193. d    /gK.12- b* g* .doc .lst .frm
  194. echo.
  195. pause
  196. cls
  197. echo The chart is improved by sorting the files by size (ss) & showing the relative
  198. echo percentage usage of each (%%). It also shows the size in terms of space used
  199. echo rather than actual size (U). If /r were added (and subdirectories were present)
  200. echo then the relative sizes of the subdirectories would be plotted.
  201. echo.
  202. echo     D /ss /%%U /g       (or D /ss/%Ug- *.BAT etc..)
  203. echo.
  204. d    /ss/%%UgK.11- b* g* .doc .lst .frm
  205. echo.
  206. pause
  207. goto stats
  208.  
  209. :exec
  210. echo PocketD can show the minimum run size of an EXE program in KBytes using /M.
  211. echo Executable files can be compressed by PKLITE, DIET, COMPACK and LZEXE. The
  212. echo /C option shows which files are compressed by flagging as p,d,c or l
  213. echo.
  214. echo     D /EMC            ( E=executable  M=exec size  C=Compress check )
  215. echo.
  216. d    /EMC
  217. echo.
  218. pause
  219. goto stats
  220.  
  221. :exten
  222. echo PocketD can summarise files and subdirs by EXTENSION, allowing the user
  223. echo to assess the space used by each extension present.
  224. echo.
  225. echo    D /e
  226. echo.
  227. d    /2eh.2K.8
  228. echo.
  229. echo This could be used with other options to provide further information. e.g.
  230. echo Showing only the top 4 extensions (in terms of size) and plotting a barchart.    
  231. echo    D /eK.4g%%/ss        (K.4 = 1st 4, /ss = sort by size, g = barchart)
  232. echo.
  233. d    /eK.4g%%/ss/h.2
  234. echo.
  235. pause
  236. goto stats
  237.  
  238. :select
  239. cls
  240. echo PocketD can apply many criteria for selecting files and subdirectories.
  241. echo.
  242. d    /Y123 /'/@tChoose://@t1. Filespecs/@t2. Size/@t3. String searching//@tESC cancel//@t?'
  243. cls
  244. if errorlevel 3 goto string
  245. if errorlevel 2 goto size
  246. if errorlevel 1 goto filesp
  247. goto main
  248.  
  249. :filesp
  250. echo PocketD uses a generalised filespec system that can include and exclude names.
  251. echo The following shows all executable files in the current directory:
  252. echo.
  253. echo  D /mhE/.u       ( m=minimum  h=no header  E=executable  /.u=unbroken names )
  254. echo.
  255. d    /mhE/.u
  256. echo.
  257. echo The group of files selected can be reduced using filespecs:
  258. echo  D /mhE/.u *L*A* G*        ( Only names with an L followed later by A
  259. echo                      or starting with the letter G )
  260. echo.
  261. d    /mhE/.u *L*A* G*
  262. echo.
  263. echo The command line can also include "exclusion" filespecs:
  264. echo  D /mhE/.u *L*A* G* /- *O* ??L*        ( also excluding all names containing O
  265. echo                          or the letter L as the 3rd character)
  266. d    /mhE/.u *L*A* G* /- *O* ??L*
  267. echo.
  268. pause
  269. cls
  270. echo PocketD also allows "type" specifications in filenames, for example:
  271. echo.
  272. echo  D *=D* *=n* /hm
  273. echo.
  274. d    *=D* *=n* /hm
  275. echo.
  276. echo This uses "=D" to match any name containing a digit, and "=n" to match
  277. echo any name that contains a non-alphanumeric character (uppercase indicates 
  278. echo match, lowercase for non-match). Also supported: =A/=a match alpha/non-alpha.
  279. echo.
  280. pause
  281. goto select
  282.  
  283. :size
  284. echo PocketD can select files by size (and also date, See D /??).
  285. echo The following shows all non-executable files sorted by size:
  286. echo.
  287. echo     D /h!Ess    ( h=no header  !E=NOT executable  ss=sort by size )
  288. echo.
  289. d    /2h!Ess/K.14
  290. echo.
  291. echo A size restriction could be added to this:    
  292. echo     D /h!Ess/}20000        ( greater or equal to 20000 )
  293. echo.
  294. D    /2h!Ess/}20000
  295. echo.
  296. echo This could be replaced by a range 3k to 4k (k=Kilobytes):
  297. echo     D /h!Ess/}3k{4k
  298. echo.
  299. D    /2h!Ess/}3k{4k
  300. pause
  301. goto select
  302.  
  303. :string
  304. echo PocketD can select files by the strings they contain (m=minimum  h=no header):
  305. echo.
  306. echo     D *.BAT /mh'not'    ( only *.BAT files containing 'not' )
  307. echo.
  308. d    *.bat /mh'not' 
  309. echo.
  310. echo This can be inverted to only those not containing 'not':
  311. echo     D *.BAT /mh!'not'    ( !'not' = not including 'not' )
  312. echo.
  313. d    *.BAT /mh!'not'
  314. echo.
  315. echo Extra options can be added to show 1st match found, but no dir listing:
  316. echo     D *.BAT /mh'not'Sd    ( S = show strings  d = no directory )
  317. echo.
  318. d    *.BAT /mh'not'Sd
  319. pause
  320. cls
  321. echo The string searching facility can be used to search for types of character,
  322. echo for example: Numeric digit, Alphabetic, Alpha-numeric, space characters etc..    
  323. echo     D *R*.BAT /hm'subdir'Sd    ( files containing the string 'subdir' )
  324. echo.
  325. d    *R*.bat /hm'subdir'Sd/- d*
  326. echo.
  327. echo This could be modified to find files with 'subdir' but not 'subdirectory':
  328. echo.
  329. echo     D *R*.BAT /hm'subdir@a'Sd    ( @a = non-alphabetic character )
  330. echo.
  331. d    *R*.bat /hm'subdir@a'Sd/- d*
  332. echo.
  333. echo Other options include L/l show/don't show line numbers, * show all strings
  334. echo and "" instead of '' for case-insensitive search.
  335. echo.
  336. pause
  337. goto select
  338.  
  339. :help
  340. cls
  341. echo PocketD comes with a number of documentation files.
  342. echo This demo only gives access to the on-line help.
  343. echo.
  344. if exist *.diz echo (PocketD will prompt the user for a number between 1-4 before allowing access)
  345. echo.
  346. echo 1. The single page help, accessed by D /?
  347. echo.
  348. pause
  349. d /?
  350. pause>nul
  351. cls
  352. echo 2. The User Guide, assessed by D /??
  353. echo.
  354. pause
  355. d /??
  356. cls
  357. echo 3. The on-line manual, given for the example D /?c
  358. echo.
  359. pause
  360. d /?c
  361. goto main
  362.  
  363. :exit
  364. cls
  365. echo DEMO terminated
  366. echo.
  367. echo This demonstration has not covered the following major features:
  368. echo.
  369. echo .  The New MENUD.EXE 60-menu front-end to D.EXE. Try it!
  370. echo .  Support of Win95 long filenames and extended date/time attributes
  371. echo .  Scrolling display and execution templates (see UNARC.BAT and Q.BAT)
  372. echo .  COPY/MOVE facilities, including copy to multi-disk, conditional copy,
  373. echo    multiple sources, subtree copying and "safe" copy features.
  374. echo .  ARCHIVE viewing and searching in ZIP/ARC/ZOO/LZH/ARJ/PAK archives
  375. echo .  Using PocketD to emulate utilities such as NCD, WHICH and MAKE etc..
  376. echo .  Using the separate display and execution TEMPLATE(s) to create utilities
  377. echo    that can intelligently interact with the user.
  378. echo .  ENVIRONMENT VARIABLE analysis from command line. e.g. D :PATH
  379. echo .  FILE SEARCH across multiple drives/subdirs using multiple criteria
  380. echo .  TOUCH and full ATTRIB modification of files
  381. echo .  SETCOL on-line file colour selection
  382. echo .  ON-LINE BROWSING of file lists and the 37 USER-DEFINED parameter names
  383. echo.
  384.  
  385. echo  You are referred to the on-line guide accessed by typing D /?? for these.
  386. echo.
  387.  
  388. echo  **** Other PocketWare products!  Have a look at the new Super-compressor CRUSH
  389. echo  **** CRUSH allows the user to create archives only half the size of PKZIP!!
  390. echo.
  391.  
  392. :fin1
  393. set d_opt2=
  394. set _=
  395. if "%d_col%"=="" goto fin
  396. :fin
  397.