home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR13 / PCK31.ZIP / DEMO.BAT < prev    next >
DOS Batch File  |  1993-10-01  |  12KB  |  364 lines

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