home *** CD-ROM | disk | FTP | other *** search
/ Boldly Go Collection / version40.iso / TS / 12B / PKBTM120.ZIP / PK.BAT < prev    next >
DOS Batch File  |  1992-04-24  |  21KB  |  1,348 lines

  1. @rem ┌─────────────────────────────────────────────────────────────────────────┐
  2. @rem │                                     4  4 DDD   OO   SSS    4  4   00    │
  3. @rem │ PKBTM Version 1.20  for             4  4 D  D O  O S       4  4  0 o0   │
  4. @rem │                                     4444 D  D O  O SSSS    4444  0o 0   │
  5. @rem │ (C) 1992 FMMO Publications             4 D  D O  O    S       4  0  0   │
  6. @rem │          Informatiques Enr.            4 DDD   OO  SSS        4 . 00    │
  7. @rem │                                                                         │
  8. @rem │ [Non-Registered Version] 04-24-92                                       │
  9. @rem ├─────────────────────────────────────────────────────────────────────────┤
  10. @rem │4DOS is a trademark of JP Software P.O. Box 1470 East Arlington, MA 02174│
  11. @rem └─────────────────────────────────────────────────────────────────────────┘
  12. @ECHO off
  13.  
  14. if not "%cwd"=="" goto not4DOS
  15.  
  16. REM MS-DOS Compatibility stops from here !
  17.  
  18. if %_4ver LT 4.0 goto not_4DOSv40
  19.  
  20. REM 4DOS v3.03 and lower Compatibility stops from here !
  21.  
  22. REM This is really where PKBTM starts
  23.  
  24.  
  25. Cls
  26. Scrput 0 0 whi on bla Working ...
  27.  
  28. REM PKBTM needs to be in overstrike mode.
  29.  
  30. Setdos /m0
  31.  
  32. Loadbtm on
  33.  
  34. Setlocal
  35. Set total_env=%_ENV
  36.  
  37. REM The following line should be replaced by the real path of your PK.INI
  38. REM file for faster operation.  Here's an example :
  39. REM Set /r d:\pathname\pk.ini >& nul
  40. REM The way this is programmed, it will use the @search command to look for
  41. REM PK.INI in all the directories specified by your path.  If PKBTM cannot
  42. REM find it, it will let you know and exit to 4DOS.
  43.  
  44. Set /r %@search[pk.ini] >& nul
  45.  
  46. REM The following line instructs 4DOS to redirect the errorlevel to a file.
  47. REM This is the only method we found to make 4DOS distinguish the file not
  48. REM found error from the Not Enough Environment error.
  49.  
  50. ECHO %_? >error
  51.  
  52. iff %@line[error,0] eq 2 then
  53.  
  54.     del error >& nul
  55.     echo Not enough environment or alias space :-(
  56.     echo.
  57.     beep 310 10
  58.     beep 210 10
  59.     echo You would have only %_ENV bytes of free environment.
  60.  
  61.     text
  62.  
  63. This is not enough to run PKBTM.
  64.  
  65. Solution :  a) run PKBTM under a 4DOS /e=4096 shell.
  66.             b) look in the main screen how much bytes of environment
  67.                PKBTM needs.
  68.             c) Add this amount to your 4DOS.INI file
  69.             d) Refer to 4DOS.DOC for more information on environment memory.
  70.  
  71.  
  72.     Endtext
  73.  
  74.     endlocal
  75.     cancel
  76.  
  77.     endiff
  78.  
  79.  
  80. iff not "%configured"=="yes" then
  81.  
  82.     del error >& nul
  83.     Echo Cannot run PKBTM :-(
  84.     beep 310 10
  85.     beep 210 10
  86.     set error=%@search[PK.INI] >& nul
  87.  
  88.  
  89.     iff "%error" ne "" then
  90.  
  91.         text
  92.  
  93. PK.INI is not properly configured to fit your system.
  94.  
  95. Solution : a) Read PKBTM.DOC.
  96.  
  97.               It is crucial for the well behavior of this BTM file that
  98.               the variables in PK.INI be configured to fit your
  99.               system.  If strange stuff keeps happening, the error is most
  100.               probably in the configuration of this file's variables.
  101.  
  102.         endtext
  103.  
  104.         else
  105.  
  106.                 text
  107.  
  108. PK.INI is not in your path or its path is not specified in PKVAR.LST.
  109.  
  110. Solution : a) Move all PKBTM files in a directory that is included
  111.               in your path statement.
  112.            b) Edit the PKBTM file and change the %@search command,
  113.               so it would point to the path of PK.INI.
  114.            c) Read 4DOS.DOC for more information on the path
  115.               statement
  116.  
  117.                 Endtext
  118.  
  119.         endiff
  120.  
  121.  
  122.     endlocal
  123.     cancel
  124.  
  125.     endiff
  126.  
  127.  
  128. del error >& nul
  129.  
  130. %keystackpath >& nul
  131.  
  132. %cursor_off
  133.  
  134. break off
  135.  
  136. pushd
  137.  
  138.  
  139. If "%1" ne "" goto fil_sel_by_cmdline
  140.  
  141.  
  142.  
  143. :pick
  144.  
  145. cls
  146.  
  147. screen 0 0 Working ...
  148.  
  149. set pkfile=!
  150.  
  151. set isitadir=no
  152.  
  153. >%processfile
  154.  
  155. set currentpath=%_cwd
  156.  
  157. select /oe set isitadir=(*.*)
  158.  
  159. iff %isitadir==. then
  160.  
  161.         goto pick
  162.  
  163.         else
  164.  
  165.                 iff %isitadir==no then
  166.  
  167.                         gosub dispabort
  168.  
  169.                         %afterquit
  170.  
  171.                         quit
  172.  
  173.  
  174.         else
  175.         
  176.                 cdd %isitadir >&> %processfile
  177.  
  178.                 endiff
  179.  
  180.         endiff
  181.  
  182.  
  183. iff %_? ne 0 then
  184.  
  185.         echo Working ...
  186.  
  187.         type %processfile |eset pkfile >nul
  188.  
  189.         keystack @83 @83 @83 @83 @83 @83 @83 @83 @83 @83 @83 @83 @83 @83 @79 8 13
  190.  
  191.         eset pkfile >nul
  192.  
  193.         goto outpick
  194.  
  195.         endiff
  196.  
  197. goto pick
  198.  
  199.  
  200.  
  201.  
  202. :fil_sel_by_cmdline
  203.  
  204. Set pkfile=%1
  205.  
  206.  
  207.  
  208. :outpick
  209.  
  210. If not "%@ext[%pkfile]"=="zip" gosub zipthis
  211.  
  212. Set pkfile=%@full[%@path[%pkfile]%@name[%pkfile].zip]
  213.  
  214. If "%flagforlogo"=="no" goto nologo
  215.  
  216. Text
  217.  
  218. Putting logo into file ...
  219.  
  220. Endtext
  221.  
  222. set error=%@exec[%pkzippath %@full[%pkfile] -z < %logofile]
  223.  
  224. If %error ne 0 goto decompressing_error
  225.  
  226.  
  227.  
  228. :nologo
  229.  
  230. If "%@descript[%@full[%pkfile]]"=="" Describe %@full[%pkfile] "%nodesc"
  231.  
  232.  
  233.  
  234. :redisplay
  235.  
  236. Cls
  237.  
  238. Gosub showtitle
  239.  
  240. Screen 6 0
  241.  
  242. Text
  243.  Current path is             :
  244.  Current working file is     :
  245.  Current file description is :
  246. Endtext
  247.  
  248. Drawbox 4 0 10 77 %boxstyle  blu on bla
  249.  
  250. Scrput 5 79 bri green on bla E
  251. VScrput 7 79 bri whi on bla %@eval[%total_env - %_ENV]
  252. Scrput 6 31 bri whi on bla %_cwd
  253. Scrput 7 31 bri whi on bla %@full[%pkfile]
  254. Scrput 8 31 bri whi on bla %@descript[%@full[%pkfile]]
  255.  
  256. if exist %downloaddirtry\*.* scrput 2 0 blink bri green on bla There is some files in %downloaddirtry
  257.  
  258. Gosub menu
  259.  
  260. Goto out
  261.  
  262.  
  263.  
  264. :menu
  265.  
  266. Screen 11 1 please select what you want to do |
  267.  
  268. Text
  269.  
  270.  
  271.  
  272.        Unarchive current file to
  273.        Clear                                                    
  274.        Update description
  275.        Select another file
  276.        Unarchive to a specified directory
  277.        View current file (for ZIP only)
  278.        Scan files in archive for viruses
  279.        Unarchive a specified file in this archive
  280. Endtext
  281.  
  282. Scrput 22 7 bri cyan on bla Simple file operations (submenu)
  283. Scrput 14 33 bri yellow on bla %downloaddirtry
  284. Scrput 15 13 bri yellow on bla %downloaddirtry
  285.  
  286. Drawbox 13 5 23 79 %boxstyle blue on bla
  287.  
  288. Set answer=%@substr[%@select[%@search[%menusel],14,0,%@eval[%_rows-1],2],1,1]
  289.  
  290. Iff "%answer" ge "0" .and. "%answer" le "8" then
  291.  
  292.         goto %@word[%answer,explode deldown describe pick unzip view scanarchive unarcspecified operations]
  293.  
  294.         else
  295.  
  296.                 cls
  297.  
  298.                 gosub dispabort
  299.  
  300.                 %afterquit
  301.  
  302.                 quit
  303.  
  304.         endiff
  305.  
  306.  
  307.  
  308.  
  309. :zipthis
  310.  
  311.  if  "%@ext[%pkfile]"=="lzh" goto lzhzip
  312.  if  "%@ext[%pkfile]"=="arc" goto arczip
  313.  if  "%@ext[%pkfile]"=="arj" goto arjzip
  314.  if  "%@ext[%pkfile]"=="zoo" goto zoozip
  315.  
  316. Gosub redisplay
  317.  
  318. Return
  319.  
  320.  
  321.  
  322. :lzhzip
  323.  
  324. Gosub maketempdir
  325.  
  326. set processlzhfile=%@full[%pkfile]
  327.  
  328. cdd %tempdir
  329.  
  330. Gosub showtitle
  331.  
  332. Screen 2 0
  333.  
  334. text
  335.  
  336. endtext
  337.  
  338. if exist %@search[%lzhpath] %lzhpath e %@full[%processlzhfile]
  339.  
  340. If %? ne 0 goto decompressing_error
  341.  
  342. Gosub filter
  343.  
  344. Gosub scanit
  345.  
  346. Del %@full[%processlzhfile]
  347.  
  348. %pkzippath %downloaddir\%@name[%pkfile].zip %tempdir\*.* -m
  349.  
  350. If %? ne 0 goto decompressing_error
  351.  
  352. cdd %downloaddir
  353.  
  354. *Rd %tempdir
  355.  
  356. Return
  357.  
  358.  
  359.  
  360. :zoozip
  361.  
  362. Gosub maketempdir
  363.  
  364. set processzoofile=%@full[%pkfile]
  365.  
  366. cdd %tempdir
  367.  
  368. Gosub showtitle
  369.  
  370. Screen 2 0
  371.  
  372. text
  373.  
  374. endtext
  375.  
  376. if exist %@search[%zoopath] %zoopath e %@full[%processzoofile]
  377.  
  378. If %? ne 0 goto decompressing_error
  379.  
  380. Gosub filter
  381.  
  382. Gosub scanit
  383.  
  384. Del %@full[%processzoofile]
  385.  
  386. %pkzippath %downloaddir\%@name[%pkfile].zip %tempdir\*.* -m
  387.  
  388. If %? ne 0 goto decompressing_error
  389.  
  390. cdd %downloaddir
  391.  
  392. *Rd %tempdir
  393.  
  394. Return
  395.  
  396.  
  397.  
  398. :arjzip
  399.  
  400. gosub showtitle
  401.  
  402. Gosub maketempdir
  403.  
  404. set processarjfile=%@full[%pkfile]
  405.  
  406. cdd %tempdir
  407.  
  408. Gosub showtitle
  409.  
  410. Screen 2 0
  411.  
  412. text
  413.  
  414. endtext
  415.  
  416. if exist %@search[%arjpath] %arjpath e %@full[%processarjfile]
  417.  
  418. If %? ne 0 goto decompressing_error
  419.  
  420. Gosub filter
  421.  
  422. Gosub scanit
  423.  
  424. Del %@full[%processarjfile]
  425.  
  426. %pkzippath %downloaddir\%@name[%pkfile].zip %tempdir\*.* -m
  427.  
  428. If %? ne 0 goto decompressing_error
  429.  
  430. cdd %downloaddir
  431.  
  432. *Rd %tempdir
  433.  
  434. Return
  435.  
  436.  
  437.  
  438. :arczip
  439.  
  440. Gosub maketempdir
  441.  
  442. set processarcfile=%@full[%pkfile]
  443.  
  444. cdd %tempdir
  445.  
  446. Gosub showtitle
  447.  
  448. Text
  449.  
  450. Endtext
  451.  
  452. if exist %@search[%arcpath] %arcpath %@full[%processarcfile]
  453.  
  454. If %? ne 0 goto decompressing_error
  455.  
  456. Gosub filter
  457.  
  458. Gosub scanit
  459.  
  460. Del %@full[%processarcfile]
  461.  
  462. %pkzippath %downloaddir\%@name[%pkfile].zip %tempdir\*.* -m
  463.  
  464. If %? ne 0 goto decompressing_error
  465.  
  466. cdd %downloaddir
  467.  
  468. *Rd %tempdir
  469.  
  470. Return
  471.  
  472.  
  473.  
  474. :unarcspecified
  475.  
  476. cls
  477.  
  478. Echo Working ...
  479.  
  480. if exist e:\arcfmmo.lst del e:\arcfmmo.lst >nul
  481.  
  482. set error=%@exec[ %pkzippath -vc %@full[%pkfile] >> %arcfmmo ]
  483.  
  484. gosub showtitle
  485.  
  486. set pickazip=%@select[%arcfmmo,3,0,%@eval[%_ROWS-1],79,Pick a line which has a zip file on it !]
  487.  
  488. iff not "%pickazip"=="" then
  489.  
  490.         cls
  491.  
  492.         else
  493.  
  494.                 goto redisplay
  495.         endiff
  496.  
  497.  
  498. set pksel=%@substr[%pickazip,60,12]
  499.  
  500. if "%pksel"="" goto redisplay
  501.  
  502. iff "%viewtolist"="on" then
  503.  
  504.         cls
  505.  
  506.         Text
  507. Gathering selected information ...
  508.  
  509. Endtext
  510.  
  511.         set error=%@exec[ %pkunzippath %@full[%pkfile] %pksel -c | %listpath /s]
  512.  
  513.         If %error ne 0 goto decompressing_error
  514.  
  515.         set viewtolist=off
  516.  
  517.         goto operations
  518.  
  519.         endiff
  520.  
  521.  
  522. cls
  523.  
  524. gosub showtitle
  525.  
  526. beep
  527.  
  528. Scrput 3 0  whi on bla The file wich you chosed to process is :
  529. Scrput 3 41 cyan on bla %pksel
  530.  
  531. Screen 5 0
  532.  
  533. %cursor_on
  534.  
  535. Inkey /K"yn" Do you want to extract it from %pkfile (y/n) ? %%answer
  536.  
  537. %cursor_off
  538.  
  539. If not "%answer"=="y" goto redisplay
  540.  
  541. Text
  542.  
  543. Hope you know what you're doing...
  544.  
  545. Endtext
  546.  
  547. set error=%@exec[ %pkunzippath %@full[%pkfile] %pksel %downloaddirtry ]
  548.  
  549. If %error ne 0 goto decompressing_error
  550.  
  551. set error=%@exec[ %Scanpath  %downloaddirtry\*.* %scanopt ]
  552.  
  553. If %error ne 0 goto dispinfected
  554.  
  555. cdd %downloaddirtry
  556.  
  557. Echo This is the contents of %downloaddirtry
  558.  
  559. *dir %diropt %downloaddirtry
  560.  
  561. Pushd
  562.  
  563. Goto out
  564.  
  565.  
  566.  
  567. :scanfile
  568.  
  569. Cls
  570.  
  571. Text
  572. This will scan all files in an archive for viruses ...
  573.  
  574. Endtext
  575.  
  576. Echo Scanning %@full[%pkfile] for viruses ...
  577.  
  578. Text
  579.  
  580. Endtext
  581.  
  582. %Scanpath  %@full[%pkfile] %scanopt
  583.  
  584. If %? ne 0 gosub dispinfected
  585.  
  586. goto redisplay
  587.  
  588.  
  589.  
  590. :explode
  591.  
  592. Cls
  593.  
  594. set error=%@exec[ %Pkunzippath %@full[%pkfile] %downloaddirtry ]
  595.  
  596. If %error NE 0 goto decompressing_error
  597.  
  598. set error=%@exec[ %Scanpath %downloaddirtry\*.* %scanopt ]
  599.  
  600. If %error ne 0 goto dispinfected
  601.  
  602. *Dir %diropt %downloaddirtry
  603.  
  604. popd *
  605.  
  606. cdd %downloaddirtry
  607.  
  608. Pushd %downloaddirtry
  609.  
  610. Goto out
  611.  
  612.  
  613.  
  614. :operations
  615.  
  616. Cls
  617.  
  618. Gosub showtitle
  619.  
  620. Scrput 12 5 bri cyan on bla -Press Escape to Go Back to Main Menu-
  621.  
  622. Screen 6 0
  623.  
  624. Text
  625.  current path is             :
  626.  current working file is     :
  627.  current file description is :
  628. Endtext
  629.  
  630. Drawbox 4 0 10 77 %boxstyle  blu on bla
  631.  
  632. Scrput 6 31 bri whi on bla %_cwd
  633. Scrput 7 31 bri whi on bla %@full[%pkfile]
  634. Scrput 8 31 bri whi on bla %@descript[%@full[%pkfile]]
  635. Screen 11 1 please select what you want to do |
  636.  
  637. Text
  638.  
  639.  
  640.  
  641.        Delete file
  642.        View file using e.g. Chris Buerg's List.com
  643.        Shell to command interpreter
  644.        Explode a selected file to the file viewer
  645.        Archive selected files in a file
  646.        Scan file for viruses
  647.        Empty slot
  648.        Empty slot
  649.        Empty slot
  650. Endtext
  651.  
  652. Drawbox 13 5 23 79 %boxstyle blue on bla
  653.  
  654. Set answer=%@substr[%@select[%@search[%menusel],14,0,%@eval[%_rows-1],2],1,1]
  655.  
  656. Iff "%answer" ge "0" .and. "%answer" le "8" then
  657.  
  658.         goto %@word[%answer,deletefile viewbuerg shellto4DOS viewflag archiveme scanfile emptyslot emptyslot]
  659.  
  660.         else
  661.  
  662.                 Cls
  663.                 Goto redisplay
  664.  
  665.         Endiff
  666.  
  667.  
  668.  
  669.  
  670. :archiveme
  671.  
  672. cls
  673.  
  674. gosub showtitle
  675.  
  676. screen 3 0
  677.  
  678. text
  679.  
  680. Intructions on how to use this function:
  681.  
  682. 1st Navigate trough directories and select files by pressing enter, or select
  683.     multiple files by presing spacebar and enter. If you select directories,
  684.     the algorythm will automatically change you to the first directory selected.
  685.  
  686. 2nd Press escape when you are done. Then you will be prompted for 2 things, if
  687.     you want to move those selected files in the archive, and after the name
  688.     of the archive.
  689.  
  690. Endtext
  691.  
  692. pause
  693.  
  694. cls
  695.  
  696. screen 0 0 Working ...
  697.  
  698. >%dirlist
  699.  
  700. >%toziplst
  701.  
  702.  
  703.  
  704. :redisp
  705.  
  706. >%liste
  707.  
  708. select /oe echo (*.*) >> %liste
  709.  
  710. screen 0 0 Working ...
  711.  
  712. text
  713.  
  714. endtext
  715.  
  716. if %@line[%liste,0] eq **eof** goto exit
  717.  
  718. set numoflin=%@eval[%@lines[%liste]-1]
  719.  
  720. set compte=-1
  721.  
  722.  
  723.  
  724. :loop
  725.  
  726. set compte=%@eval[%compte+1]
  727.  
  728. iff isdir %@line[%liste,%compte] then
  729.  
  730.         echo %@line[%liste,%compte] >> %dirlist
  731.  
  732.         else
  733.  
  734.                 echo %@full[%@line[%liste,%compte]] >> %toziplst
  735.         endiff
  736.  
  737.  
  738. if not %compte GT %numoflin goto loop
  739.  
  740. if %@filesize[%dirlist] eq 0 goto redisp
  741.  
  742. iff %@line[%dirlist,0] eq . then
  743.  
  744.         >%dirlist
  745.  
  746.         goto redisp
  747.  
  748.         else
  749.  
  750.                 cdd %@line[%dirlist,0]
  751.  
  752.                 >%dirlist
  753.  
  754.                 goto redisp
  755.  
  756.         endiff
  757.  
  758.  
  759.  
  760. :exit
  761.  
  762. text
  763.  
  764. endtext
  765.  
  766. %cursor_on
  767.  
  768. inkey /k"yn" Do you want to move the selected files in the archive (Y/N) ? : %%moveyn
  769.  
  770. %cursor_off
  771.  
  772. text
  773.  
  774. endtext
  775.  
  776. %cursor_on
  777.  
  778. input How will you name the archive ? : %%filename
  779.  
  780. %cursor_off
  781.  
  782. if "%filename" eq "" goto operations
  783.  
  784. iff %moveyn eq y then
  785.  
  786.         set moveyn=-m
  787.  
  788.         else
  789.  
  790.                 unset moveyn
  791.  
  792.         endiff
  793.  
  794. set error=%@exec[ pkzip %moveyn %filename @%toziplst ]
  795.  
  796. unset moveyn
  797.  
  798. If %error ne 0 goto decompressing_error
  799.  
  800. goto operations
  801.  
  802.  
  803.  
  804.  
  805. :viewflag
  806.  
  807. set viewtolist=on
  808.  
  809. goto unarcspecified
  810.  
  811.  
  812.  
  813. :deletefile
  814.  
  815. cls
  816.  
  817. Echo Deleting %@full[%pkfile] ..
  818.  
  819. Del %@full[%pkfile] >nul
  820.  
  821. goto pick
  822.  
  823.  
  824.  
  825. :scanarchive
  826.  
  827. Cls
  828.  
  829. Echo Unarchiving files in archive %@full[%pkfile] for viruses ...
  830.  
  831. set error=%@exec[ %pkunzippath %@full[%pkfile] %pksel %downloaddirtry ]
  832.  
  833. If %error ne 0 goto decompressing_error
  834.  
  835. Echo Scanning files in archive %@full[%pkfile] for viruses ...
  836.  
  837. set error=%@exec[ %Scanpath %downloaddirtry\*.* %scanopt ]
  838.  
  839. If %error ne 0 goto dispinfected
  840.  
  841. Text
  842. Deleting files from directory ...
  843.  
  844. Endtext
  845.  
  846. set result=%@exec[%deleteprotect_off >& nul ]
  847.  
  848. If exist %downloaddirtry\*.* del %downloaddirtry\*.* /y /q >& nul
  849.  
  850. set result=%@exec[%deleteprotect_on >& nul ]
  851.  
  852. goto pick
  853.  
  854.  
  855.  
  856.  
  857. :movefile
  858.  
  859. :copyfile
  860.  
  861. :edit file
  862.  
  863. :execute_file
  864.  
  865.  
  866.  
  867. :shellto4dos
  868.  
  869. set result=%@exec[%comspec]
  870.  
  871. goto operations
  872.  
  873.  
  874. :viewbuerg
  875.  
  876. iff exist %@search[%listpath] then
  877.  
  878.         set result=%@exec[ %listpath %@full[%pkfile] ]
  879.  
  880.         endiff
  881.  
  882. Goto operations
  883.  
  884.  
  885.  
  886. :emptyslot
  887.  
  888. cls
  889.  
  890. Text
  891.  
  892. This is an empty slot so you could put something of your own !
  893. If you register, we will be glad to send you some usable code
  894. to fill all those empty slots and more !
  895.  
  896. Just shell and go read pkbtm.doc
  897. Endtext
  898.  
  899. Pause
  900.  
  901. Goto operations
  902.  
  903.  
  904.  
  905. :describe
  906.  
  907. Keystack "%@descript[%@full[%pkfile]]"
  908.  
  909.  
  910. :reask
  911.  
  912. Scrput 3 0 bri red on bla Enter the new description.  Press ESC and ENTER to be prompted for a choice !
  913. Screen 9 30 └────────────────────────────────────────┘
  914. Screen 8 31
  915.  
  916. %cursor_on
  917.  
  918. Input %%newdes
  919.  
  920. %cursor_off
  921.  
  922. Iff %@len[%newdes] gt 40 then
  923.  
  924.         Keystack "%newdes"
  925.  
  926.         Goto reask
  927.  
  928.         Endiff
  929.  
  930.  
  931.  
  932. :descentered
  933.  
  934. Iff "%newdes" ne "" then
  935.  
  936.         describe %@full[%pkfile] ""
  937.  
  938.         echo %newdes | describe %@full[%pkfile] >nul
  939.  
  940.         goto redisplay
  941.  
  942.         endiff
  943.  
  944. cls
  945.  
  946. set newdes=%@select[%desc_list,2,0,24,79,Please Select a Description Among These !]
  947.  
  948. If not "%newdes" ne "" set newdes=%nodesc
  949.  
  950. goto descentered
  951.  
  952.  
  953.  
  954.  
  955. :deldown
  956.  
  957. Cls
  958.  
  959. Echo This is the content of %downloaddirtry
  960.  
  961. Text
  962.  
  963. Endtext
  964.  
  965. *Dir %diropt %downloaddirtry
  966.  
  967. Text
  968.  
  969. Endtext
  970.  
  971. %cursor_on
  972.  
  973. Inkey /K"yn" Do you want to delete the content of %downloaddirtry (y/n) : %%answer
  974.  
  975. %cursor_off
  976.  
  977. Iff "%answer"=="y" then
  978.  
  979.         Text
  980.  
  981.         Deleting...
  982.  
  983.         endtext
  984.  
  985.         set result=%@exec[%deleteprotect_off >& nul ]
  986.  
  987.         If exist %downloaddirtry\*.* del %downloaddirtry\*.* /y /q >& nul
  988.  
  989.         set result=%@exec[%deleteprotect_on >& nul ]
  990.  
  991.         Goto redisplay
  992.  
  993.         Endiff
  994.  
  995. text
  996.  
  997. endtext
  998.  
  999. %cursor_on
  1000.  
  1001. Inkey /K"yn" Do you want to move that somewhere ? (y/n) : %%answer
  1002.  
  1003. %cursor_off
  1004.  
  1005. If "%answer"=="n" goto redisplay
  1006.  
  1007. Text
  1008.  
  1009. Endtext
  1010.  
  1011. %cursor_on
  1012.  
  1013. Input Where do you want to move that (ENTER to quit): %%where
  1014.  
  1015. %cursor_off
  1016.  
  1017. If "%where"=="" goto redisplay
  1018.  
  1019. Iff not isdir %where then
  1020.  
  1021.         Text
  1022.  
  1023. You need to specify an existing directory !
  1024. I'll try to create it ...
  1025.  
  1026.         endtext
  1027.  
  1028.         goto makedir
  1029.  
  1030.         endiff
  1031.  
  1032. Echo Moving files to %where ...
  1033.  
  1034. *Move %downloaddirtry\*.* %where
  1035.  
  1036. Iff %_? NE 0 then
  1037.  
  1038.         text
  1039. An error as occured when moving files ..
  1040. Quitting...
  1041.         endtext
  1042.  
  1043.         %afterquit
  1044.  
  1045.         cancel
  1046.  
  1047.         else
  1048.  
  1049.                 Goto redisplay
  1050.  
  1051.         endiff
  1052.  
  1053.  
  1054.  
  1055. :makedir
  1056.  
  1057. *Md  %where >& nul
  1058.  
  1059. Set error=%_?
  1060.  
  1061. Text
  1062.  
  1063. Endtext
  1064.  
  1065. If "%error" != "0" goto imposs_dir
  1066.  
  1067. Echo The directory %where was succesfully created !
  1068. Echo Moving files to %where ...
  1069.  
  1070. Text
  1071.  
  1072. Endtext
  1073.  
  1074. *Move %downloaddirtry\*.* %where
  1075.  
  1076. Goto redisplay
  1077.  
  1078.  
  1079.  
  1080. :imposs_dir
  1081.  
  1082. Text
  1083.  
  1084. 4DOS is not able to create this directory :-)
  1085. Please revise 4DOS.DOC !
  1086.  
  1087. Endtext
  1088.  
  1089. Pause
  1090.  
  1091. Goto redisplay
  1092.  
  1093.  
  1094.  
  1095. :view
  1096.  
  1097. Cls
  1098.  
  1099. Echo Gathering information on zip file...
  1100.  
  1101.  
  1102. Iff "%@ext[%@full[%pkfile]]"=="zip" then
  1103.  
  1104.         set error=%@exec[ %pkzippath -vc %@full[%pkfile] | %listpath /s ]
  1105.  
  1106.         else
  1107.  
  1108.                 Text
  1109.  
  1110. Not a zip archive ...
  1111.                 Endtext
  1112.  
  1113.                 pause
  1114.  
  1115.         endiff
  1116.  
  1117.  
  1118. @goto redisplay
  1119.  
  1120.  
  1121.  
  1122.  
  1123. :unzip
  1124.  
  1125. Cls
  1126.  
  1127. %cursor_on
  1128.  
  1129. Input Where do you want to unzip %pkfile : %%where
  1130.  
  1131. %cursor_off
  1132.  
  1133. If "%where"=="" goto redisplay
  1134.  
  1135. If isdir %where goto dirok
  1136.  
  1137. *md %where >& nul
  1138.  
  1139. Set error=%_?
  1140.  
  1141. Text
  1142.  
  1143. Endtext
  1144.  
  1145. If %error != 0 goto imposs_dir
  1146.  
  1147. Text
  1148.  
  1149. Endtext
  1150.  
  1151. Echo The directory %where was succesfully created !
  1152.  
  1153.  
  1154.  
  1155.  
  1156. :dirok
  1157.  
  1158. Text
  1159.  
  1160. Endtext
  1161.  
  1162. Echo Unzippping files to %where ...
  1163.  
  1164. set error=%@exec[%Pkunzippath %@full[%pkfile] %where]
  1165.  
  1166. If %error NE 0 goto decompressing_error
  1167.  
  1168. %Scanpath  %where /d %scanopt
  1169.  
  1170. If  %? ne 0 goto dispinfected
  1171.  
  1172. cdd %where
  1173.  
  1174. Cls
  1175.  
  1176. Echo This is the content of %where
  1177.  
  1178. *Dir %diropt %where >&>nul
  1179.  
  1180. Pushd
  1181.  
  1182. Goto out
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190. :acm
  1191.  
  1192. Cls
  1193.  
  1194. Text
  1195.  
  1196. Loading arcmaster....
  1197.  
  1198. Endtext
  1199.  
  1200. %arcmaster
  1201.  
  1202. Goto redisplay
  1203.  
  1204.  
  1205.  
  1206.  
  1207. :decompressing_error
  1208.  
  1209. Text
  1210. 
  1211. An error occured when processing this file.
  1212. Please fix the problem.
  1213. Endtext
  1214.  
  1215. %afterquit
  1216.  
  1217. Cancel
  1218.  
  1219.  
  1220. :dispabort
  1221.  
  1222.  
  1223. Text
  1224. [UNREGISTERED EVALUATION COPY]
  1225. Thanks for evaluating FMMO's software.
  1226. Have a nice 4DOS !
  1227. Endtext
  1228.  
  1229.  
  1230. Return
  1231.  
  1232.  
  1233.  
  1234.  
  1235. :scanit
  1236.  
  1237. %Scanpath %tempdir %scanopt
  1238.  
  1239. If  %? ne 0 goto dispinfected
  1240.  
  1241. Return
  1242.  
  1243.  
  1244.  
  1245.  
  1246. :filter
  1247.  
  1248. If exist readmy.bbs del readmy.bbs
  1249.  
  1250. If exist readme.ros del readme.ros
  1251.  
  1252. If exist fmmobbs.doc del fmmobbs.doc
  1253.  
  1254. Return
  1255.  
  1256.  
  1257.  
  1258. :maketempdir
  1259.  
  1260.  
  1261. If not isdir %tempdir *md %tempdir
  1262.  
  1263. iff %_? ne 0 then
  1264.  
  1265.         text
  1266.         Fatal error
  1267.         Could not create directory
  1268.         endtext
  1269.  
  1270.         goto out
  1271.  
  1272.         endiff
  1273.  
  1274. Return
  1275.  
  1276.  
  1277.  
  1278.  
  1279. :showtitle
  1280.  
  1281.  
  1282. cls
  1283.  
  1284. Scrput 0 0 bri yellow on blu ≡        PKBTM v1.20 (C) 1991,1992 FMMO Publications Informatiques Enr.        ≡
  1285.  
  1286. Drawhline 1 0 80 1 blu on bla
  1287.  
  1288. Return
  1289.  
  1290.  
  1291.  
  1292.  
  1293. :dispinfected
  1294.  
  1295. Text
  1296. This archive seems to be infected with a virus
  1297. Watch Out! The original file is still in it's original form
  1298. Quitting...
  1299. Endtext
  1300.  
  1301. del %tempdir\*.* /y /q
  1302.  
  1303. cdd %downloaddir
  1304.  
  1305. *rd %tempdir
  1306.  
  1307. goto out
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313. :out
  1314.  
  1315. %afterquit
  1316.  
  1317. Popd >& nul
  1318.  
  1319. quit
  1320.  
  1321.  
  1322.  
  1323.  
  1324. :not_4DOSv40
  1325.  
  1326. Echo PKBTM is constantly updated to use the latest 4DOS functions.
  1327. Echo As of now, the most recent version of 4DOS is 4.0/rev B1 release.
  1328. Echo Please read the file magicn.fmo for more information !
  1329.  
  1330. quit
  1331.  
  1332.  
  1333. :not4DOS
  1334.  
  1335. @echo 
  1336. @echo 4DOS (tm) is not loaded on your system.
  1337. @echo.
  1338. @echo Shame on you :-)
  1339. @echo.
  1340. @echo For PKBTM to run, 4DOS must be loaded on your system.
  1341. @echo.
  1342. @echo Feel free to download or request the latest version of 4DOS (tm) JPSoftware
  1343. @echo from FMMHOST BBS in Sherbrooke, Qc.
  1344. @echo.
  1345. @echo Please read magicn.fmo for more information.
  1346. @echo.
  1347. @echo We are an official 4DOS Distribution Site !
  1348.