home *** CD-ROM | disk | FTP | other *** search
/ Windoware / WINDOWARE_1_6.iso / winutil / cp_70r / cmdpost.cp$ < prev    next >
Text File  |  1991-01-25  |  19KB  |  615 lines

  1. ; Define addon menu   USER menus should go into CMDUSER.CPM...by convention...
  2. #NextFile CMDUSER.CPM
  3.  
  4.  
  5. ; CmdPost menu    initialization code
  6.  
  7.     ; Initialize a few variables here. 
  8.       
  9.     a=Version()
  10.     CP="CmdPost"
  11.     CPDIR=DirHome()
  12.  
  13.     ; *******TO CHANGE TITLES, USE THE Main.ResetOptions command - automagic now!
  14.     TitleFirst=iniread(CP,"TitleFirst","Command Post - Window 1")
  15.     TitleSecond=iniread(CP,"TitleSecond","Command Post - Window 2")
  16.     if !IsLicensed() then TitleFirst="Command Post %a% - Eval Only"
  17.     if !IsLicensed() then TitleSecond ="Command Post %a% # Eval Only"
  18.     crlf=strcat(num2char(13),num2char(10))
  19.     tab=num2char(9)
  20.  
  21. ; Setting up the View menu item here.
  22.  
  23.     ViewShortLong=iniread(CP,"ViewShortLong","SHORT")
  24.  
  25.     if ViewShortLong=="SHORT" then MenuChange("ViewShort",@CHECK)
  26.     if ViewShortLong=="LONG" then MenuChange("ViewLong",@CHECK)
  27.     
  28.     ViewBy=iniread(CP,"ViewBy","NAME")
  29.     if ViewBy=="NAME" then MenuChange("ViewByName",@CHECK)
  30.     if ViewBy=="DATE" then MenuChange("ViewByDate",@CHECK)
  31.     if ViewBy=="SIZE" then MenuChange("ViewBySize",@CHECK)
  32.     if ViewBy=="KIND" then MenuChange("ViewByKind",@CHECK)
  33.     if ViewBy=="UNSORTED" then MenuChange("ViewUnsorted",@CHECK)
  34.  
  35.     ViewWhat=iniread(CP,"ViewWhat","ALL")
  36.     if ViewWhat=="ALL" then MenuChange("ViewAll",@CHECK)
  37.     if ViewWhat=="PARTIAL" then MenuChange("ViewPartial",@CHECK)
  38.     if ViewWhat=="PROGRAMS" then MenuChange("ViewPrograms",@CHECK)
  39.  
  40.     SD3="*.*"
  41.     if ViewWhat=="PROGRAMS" then SD3="*.EXE *.COM *.BAT *.PIF"
  42.     if ViewWhat=="PARTIAL" then SD3=iniread(CP,"Partial","*.*")
  43.     SetDisplay(ViewShortLong,ViewBy,SD3)
  44.     drop(a,ViewShortLong,ViewBy,ViewWhat,SD3)
  45.  
  46. ; Setup Print menu item...Kill it if no text printer
  47.     MenuChange("FilePrint", (IniRead(CP,"TextPrinter","")=="NONE") *@DISABLE)
  48. ; Setup Screen Blank Time.  Get time from win.ini
  49.     a=iniread(CP,"BlankTime",5)
  50.     if a!=9999 then run("%CPDIR%cp_blnk.exe",a)
  51. ;                             ;    <0....blanking with no clock
  52. ;                             ;     0... no blanking, but have a clock
  53. ;                             ;    >0... blanking and clock
  54. ;                             ;    9999  Don't even run it.
  55. ;                             ;    multiple startups ignored.
  56.  
  57.  
  58.     if IsRunning() then goto MORETHANONE   ;More than one CP running
  59.     WinTitle("",TitleFirst);Title of first 'Post
  60.     a=IniRead(CP,"WinPosition","0,0,1000,@ABOVEICONS")
  61.     WinPlace(%a%,"")
  62.     Exit
  63.  
  64.     :MORETHANONE
  65.     TitleTemp=TitleSecond
  66.     if !WinExist(TitleFirst) then TitleTemp=TitleFirst
  67.     WinTitle("",TitleTemp)      ;Title of this 'Post
  68.     WinPlace(500,0,1000,@ABOVEICONS,TitleSecond)
  69.     WinPlace(0,0,500,@ABOVEICONS,TitleFirst)
  70.  
  71.     ;Do not Drop TitleFirst,TitleSecond,crlf,tab,CP as these are used
  72.     ;in following menu items.
  73.     Drop(a,TitleTemp)
  74.  
  75. ; And the main menu starts.  
  76. &File
  77.  &Run...
  78.     r=CurrentFile()
  79.     if !IsKeyDown(@SHIFT) then r=askline("RUN","Enter file to run",r)
  80.     r=strcat(strtrim(r)," ")
  81.     i=strindex(r," ",0,@FWDSCAN)
  82.     run(strsub(r,1,i-1),strtrim(strsub(r,i,strlen(r)-i+1)))
  83.     drop(a,r,i)        
  84.  &Load...
  85.     r=CurrentFile()
  86.     if !IsKeyDown(@SHIFT) then l=askline("LOAD","Enter file to load",CurrentFile())
  87.     l=strcat(strtrim(l)," ")
  88.     i=strindex(l," ",0,@FWDSCAN)
  89.     runicon(strsub(l,1,i-1),strtrim(strsub(l,i,strlen(l)-i+1)))
  90.     drop(a,i,l)
  91.  Bro&wse...
  92.     l=CurrentFile()
  93.     if !IsKeyDown(@SHIFT) then l=askline("Browse","Enter file to browse",l)
  94.     run("%CPDIR%browser.exe",l)
  95.     drop(a,l)
  96.  &Notepad Edit...
  97.     l=CurrentFile()
  98.     if !IsKeyDown(@SHIFT) then l=askline("Notepad Edit","Enter file to edit",l)
  99.     if l=="" || l==" " then goto NULL
  100.     a=strscan(l,".\",0,@BACKSCAN)
  101.     if a==0 then l=strcat(l,".")
  102.     if a==0 then goto NULL
  103.     if strsub(l,a,1)!="." then l=strcat(l,".")
  104.      :NULL
  105.     run("notepad.exe",l)
  106.     drop(a,l)
  107.  &Copy... \ {F8}
  108.     r=OtherDir()
  109.     s=strcat(DirItemize("")," ",FileItemize(""))
  110.     terminate(strlen(s)==1,"Copy Error","No files selected")
  111.     if !IsKeyDown(@SHIFT) then r=askline("Copy",StrCat(s,crlf,crlf,"to"),r)
  112.     terminate(r=="","Copy Error","Cannot copy to null file name")        
  113.     q=strindex(r,"\",0,@FWDSCAN) ; Directory Name in there??
  114.     if q==0 then SetDisplay("","","") ;Nope. Set flag to update directory
  115.     FileCopy(s,r,@TRUE)
  116.     OtherUpdate()
  117.     drop(r,s,q)
  118.  &Move/Rename...  \  {F7}
  119.     r=OtherDir()
  120.     s=strcat(DirItemize("")," ",FileItemize(""))
  121.     terminate(strlen(s)==1,"Move Error","No files selected")
  122.     if !IsKeyDown(@SHIFT) then r=askline("Move",StrCat(s,crlf,crlf,"to"),r)
  123.     terminate(r=="","Move Error","Cannot move to null file name")
  124.     SetDisplay("","","") ;Set flag to update directory
  125.     FileMove(s,r,@TRUE)
  126.     OtherUpdate()
  127.     drop(r,s)
  128.  &Delete File... \ {DEL}
  129.     f=FileItemize("")
  130.     g=DirItemize("")
  131.     b=0
  132.     if strlen(g)!=0 then b=AskYesNo("!!! Warning !!! ",strcat("Delete files from these directories too?",crlf,g))
  133.     if b!=0 then f=strcat(g," ",f)
  134.     terminate(strlen(f)==0,"delete","No files specified")
  135.     if !IsKeyDown(@SHIFT) then if askyesno("Delete",f)==@NO then exit
  136.     SetDisplay("","","") ;Set flag to update directory
  137.     FileDelete(f)
  138.     OtherUpdate()  ; Well if the "other" CmdPost Window points to the
  139.             ; same directory, it *IS* nice...
  140.     drop(f,g,b)
  141.  
  142.  &Print...
  143.     s=FileItemize("")
  144.     terminate(strlen(s)==0,"Print Error","No files selected")
  145.     TextPrinter=iniread(CP,"TextPrinter","ASK")
  146.     if TextPrinter!="ASK" then goto NOASK1
  147.     r=AskYesNo("Attention",strcat("This print routine only works with standard printers.",crlf,"Do you have a standard (NON-Postscript) printer?"))
  148.     if r==@YES then goto ASK1
  149.     iniwrite(CP,"TextPrinter","NONE")
  150.     MenuChange("FilePrint",@DISABLE)
  151.     Exit
  152.     :ASK1
  153.     TextPrinter="NONE|LPT1|LPT2|LPT3"
  154.     TextPrinter=ItemSelect("Choose the STD text printer",TextPrinter,"|")
  155.     terminate(strlen(TextPrinter)==0,"Error","Nothing chosen")
  156.     iniwrite(CP,"TextPrinter",TextPrinter)
  157.     :NOASK1
  158.     Terminate(TextPrinter=="NONE","ERROR","No Text Printers on system")
  159.     a=AskLine("Print",strcat(s,crlf,crlf,"to"),TextPrinter)
  160.     FileCopy(s,a,@FALSE)
  161.  _&Hilite Files
  162.     a=AskLine("Hilite Files","Enter types of files to hilite",strcat("*.",FileExtension(CurrentFile())))
  163.     FileHilite(a,@TRUE)
  164.  &Unhilite Files
  165.     a=AskLine("Unhilite Files","Enter types of files to unhilite",strcat("*.",FileExtension(CurrentFile())))
  166.     FileHilite(a,@FALSE)
  167.  _&Size of selected files
  168.     message("Total size of files",strcat(FileSize(FileItemize(""))," Bytes"))
  169.  
  170.  &Freespace on Drives   
  171. ;        This code initially asks for your last drive
  172. ;        (It does assume you have no holes between C and the
  173. ;         last drive...)
  174. ;        and then computes disk space based on the last drive
  175.  
  176.     NextDrive="C"    ;ASSUMES C is your first hard drive.
  177.     TotalSize=0
  178.     DriveReport=""
  179.     LastDrive=iniread(CP,"LastDrive","ASK")
  180.     if LastDrive!="ASK" then goto COUNTSPACE
  181.     LastDrive=AskLine("Setup Question",strcat("Enter letter of last (contiguous) disk drive",crlf,"C D E F G H ...Z"),"C")
  182.     LastDrive=StrUpper(LastDrive)
  183.     iniwrite(CP,"LastDrive",LastDrive)
  184.  
  185.     :COUNTSPACE
  186.     ; Always do C drive
  187.     a=DiskFree(NextDrive)/1024
  188.     TotalSize=a+TotalSize
  189.     DriveReport=strcat(DriveReport,crlf,NextDrive," = ",a,"K")
  190.     NextDrive=num2char(char2num(NextDrive)+1)
  191.     if NextDrive<=LastDrive then goto COUNTSPACE
  192.  
  193.     Message("Total Space = %TotalSize%K",DriveReport)
  194.     Drop(xxx,TotalSize,DriveReport,NextDrive,LastDrive)
  195.  
  196.  Space on &A and size of files
  197.     message(strcat("Drive A ",DiskFree("A")),strcat("Selected Files ",FileSize(FileItemize(""))))
  198.  
  199.  
  200.  Space on &B and size of files
  201.     message(strcat("Drive B ",DiskFree("B")),strcat("Selected Files ",FileSize(FileItemize(""))))
  202.  
  203.  
  204.  _&Extensions...
  205.     a=strtrim(CurrentFile())
  206.     i=strindex(a,".",0,@FWDSCAN)
  207.     terminate(i==0,"Association Error","Associated files must have an extension")
  208.     b=FileExtension(a)
  209.     c=iniread("extensions",b,"???.EXE ^.%b%")
  210.     d=askline("Associate","%b% files are associated with",c)
  211.     terminate(c==d,"","")
  212.     iniwrite("extensions",b,d)
  213.  _E&xit Windows \ ^X
  214.     EndSession()
  215.     
  216. &Dir
  217.  Crea&te Directory...
  218.     a=askline("Create Directory","Enter directory to create","")
  219.     terminate(a=="","Create Error","Cannot create directory with null name")
  220.     DirMake(a)
  221.     SetDisplay("","","")
  222.     drop(a)
  223.  
  224.  &Rename Directory...
  225.     a=DirItemize("")
  226.     terminate(ItemCount(a," ")!=1,"Rename Error","Zero or more than one dir specified")
  227.     b=AskLine("Rename Directory","Enter new directory name for %a%",a)
  228.     terminate(a==b || b=="","Rename Error","Illegal name change specified")
  229.     DirRename(a,b)
  230.     SetDisplay("","","")
  231.     OtherUpdate()
  232.     drop(a,b)
  233.  
  234.  &Delete Directory...
  235.     f=DirItemize("")
  236.     terminate(strlen(f)==0,"Delete Directory","No directory specified")
  237.     terminate(@no==askyesno("Delete Directory",f),"Delete Directory","Directory not deleted")
  238.     DirRemove(f)
  239.     SetDisplay("","","")
  240.     OtherUpdate()   ; Well if the "other" CmdPost Window points to the
  241.               ; same directory, it *is* nice
  242.     drop(f)
  243.  
  244.  &Change Directory...
  245.     a=DirGet()
  246.     b=strindex(a,':',1,@fwdscan)
  247.     c=askline("Change Directory","Enter directory name",strsub(a,b+1,strlen(a)-b-1))
  248.     terminate(c=="","Directory Error","Directory with null name does not exist")
  249.     DirChange(c)
  250.     SetDisplay("","","")
  251.     drop(a,b,c)
  252.  
  253.  _&Format Diskette...
  254.     ; A wonderful example of variable substitution
  255.     D1="1) 5.25 High Density (1.2M)"
  256.     D2="2) 5.25 Standard (360K)"
  257.     D3="3) 3.5  High Density (1.44M)"
  258.     D4="4) 3.5  Standard (720K)"
  259.     D0="0) None"
  260.     DriveA=iniread(CP,"DriveA","ASK")
  261.     DriveB=iniread(CP,"DriveB","ASK")
  262.     if DriveA!="ASK" & DriveB!="ASK" then goto DOFORMAT
  263.  
  264.     DC="%D1%|%D2%|%D3%|%D4%|%D0%"
  265.     Message("Attention","Command Post needs to learn what kind of floppies %crlf% the system has.  Please select accordingly.")
  266.     :ASKA
  267.     a=ItemSelect("Select type of Drive A",DC,"|")
  268.     if a!="" then goto OKDRIVEA
  269.     Message("You MUST select an option for A.","Please retry")
  270.     goto ASKA
  271.     :OKDRIVEA
  272.     DriveA=strsub(a,1,1)
  273.     iniwrite(CP,"DriveA",DriveA)
  274.  
  275.     :ASKB
  276.     a=ItemSelect("Select type of Drive B",DC,"|")
  277.     if a!="" then goto OKDRIVEB
  278.     Message("You MUST select an option for B.","Please retry")
  279.     goto ASKB
  280.     :OKDRIVEB
  281.     DriveB=strsub(a,1,1)
  282.     iniwrite(CP,"DriveB",DriveB)
  283.  
  284.     :DOFORMAT
  285.     A0=""
  286.     A1="1)    A:   5.25 HD (1.2M)|2)    A:   5.25 DD (360K)"
  287.     A2="2)    A:   5.25 DD (360K)"
  288.     A3="3)    A:   3.5 HD (1.44M)|4)    A:   3.5 Std (720K)"
  289.     A4="4)    A:   3.5 Standard (720K)"
  290.     B0=""
  291.     B1="5)    B:   5.25 HD (1.2M)|6)    B:   5.25 DD (360K)"
  292.     B2="6)    B:   5.25 Standard (360K)"
  293.     B3="7)    B:   3.5 HD (1.44M)|8)    B:   3.5 DD (720K)"
  294.     B4="8)    B:   3.5 DD (720K)"
  295.     FF=strcat(A%DriveA%,"|",B%DriveB%)
  296.     drop(A0,A1,A2,A3,A4,B0,B1,B2,B3,B4)
  297.  
  298.     FF=ItemSelect("Choose Format Type Desired",FF,"|")
  299.     terminate(FF=="","Format","No parameters selected")
  300.  
  301.     FF=strsub(FF,1,1)   ; FF will be 1 thru 8 (with luck)
  302.     DR=strsub("AB",(FF>4)+1,1)  ; DR is desired drive
  303.     FF=FF-((FF>4)*4)            ; FF is 1 thru 4
  304.     F11=""
  305.     F12="/4"
  306.     F22=""
  307.     F33=""
  308.     F34="/n:9 /t:80"
  309.     F44=""
  310.     DC=Drive%DR%   ; get drive type
  311.     FC=F%DC%%FF%
  312.     FC="%DR%:  %FC%"
  313.     DC=strsub(D%FF%,4,strlen(d%FF%)-3)
  314.     Pause("Attention",strcat("Preparing to format %DC%",crlf,"diskette in Drive %DR% with command:",crlf,"FORMAT %FC%"))
  315.     run("command.com","/c format.com %FC%")
  316.     drop(D0,D1,D2,D3,D4,DC,xxx,DriveA,DriveB)
  317.     drop(FF,DR,F11,F12,F22,F33,F34,F44,DC,FC)
  318.  
  319.  _Directory &Tree
  320.     run("%CPDIR%cp_tree.exe","")
  321.  
  322.  
  323.  
  324. &View
  325.  &Short
  326.     SetDisplay("SHORT","","")
  327.     MenuChange("ViewShort",@CHECK)
  328.     MenuChange("ViewLong",@UNCHECK)
  329.     iniwrite(CP,"ViewShortLong","SHORT")
  330.  &Long
  331.     SetDisplay("LONG","","")
  332.     MenuChange("ViewShort",@UNCHECK)
  333.     MenuChange("ViewLong",@CHECK)
  334.     iniwrite(CP,"ViewShortLong","LONG")
  335.  _&All
  336.     SetDisplay("","","*.*")
  337.     MenuChange("ViewAll",@CHECK)
  338.     MenuChange("ViewPartial",@UNCHECK)
  339.     MenuChange("ViewPrograms",@UNCHECK)
  340.     iniwrite(CP,"ViewWhat","ALL")
  341.  &Partial...
  342.     a=iniread(CP,"Partial","*.*")
  343.     a=AskLine("View Partial","Enter types of files desired",a)
  344.     iniwrite(CP,"Partial",a)
  345.     SetDisplay("","",a)
  346.     MenuChange("ViewAll",@UNCHECK)
  347.     MenuChange("ViewPartial",@CHECK)
  348.     MenuChange("ViewPrograms",@UNCHECK)
  349.     iniwrite(CP,"ViewWhat","PARTIAL")
  350.  P&rograms
  351.     SetDisplay("","","*.EXE *.COM *.BAT *.PIF")
  352.     MenuChange("ViewAll",@UNCHECK)
  353.     MenuChange("ViewPartial",@UNCHECK)
  354.     MenuChange("ViewPrograms",@CHECK)
  355.     iniwrite(CP,"ViewWhat","PROGRAMS")
  356.  _By &Name
  357.     SetDisplay("","NAME","")
  358.     MenuChange("ViewByName",@CHECK)
  359.     MenuChange("ViewByDate",@UNCHECK)
  360.     MenuChange("ViewBySize",@UNCHECK)
  361.     MenuChange("ViewByKind",@UNCHECK)
  362.     MenuChange("ViewUnsorted",@UNCHECK)
  363.     iniwrite(CP,"ViewBy","NAME")
  364.  By &Date
  365.     SetDisplay("","DATE","")
  366.     MenuChange("ViewByName",@UNCHECK)
  367.     MenuChange("ViewByDate",@CHECK)
  368.     MenuChange("ViewBySize",@UNCHECK)
  369.     MenuChange("ViewByKind",@UNCHECK)
  370.     MenuChange("ViewUnsorted",@UNCHECK)
  371.     iniwrite(CP,"ViewBy","DATE")
  372.  By Si&ze
  373.     SetDisplay("","SIZE","")
  374.     MenuChange("ViewByName",@UNCHECK)
  375.     MenuChange("ViewByDate",@UNCHECK)
  376.     MenuChange("ViewBySize",@CHECK)
  377.     MenuChange("ViewByKind",@UNCHECK)
  378.     MenuChange("ViewUnsorted",@UNCHECK)
  379.     iniwrite(CP,"ViewBy","SIZE")
  380.  By &Kind       
  381.     SetDisplay("","KIND","")
  382.     MenuChange("ViewByName",@UNCHECK)
  383.     MenuChange("ViewByDate",@UNCHECK)
  384.     MenuChange("ViewBySize",@UNCHECK)
  385.     MenuChange("ViewByKind",@CHECK)
  386.     MenuChange("ViewUnsorted",@UNCHECK)
  387.     iniwrite(CP,"ViewBy","KIND")
  388.  &Unsorted
  389.     SetDisplay("","UNSORTED","")
  390.     MenuChange("ViewByName",@UNCHECK)
  391.     MenuChange("ViewByDate",@UNCHECK)
  392.     MenuChange("ViewBySize",@UNCHECK)
  393.     MenuChange("ViewByKind",@UNCHECK)
  394.     MenuChange("ViewUnsorted",@CHECK)
  395.     iniwrite(CP,"ViewBy","UNSORTED")
  396.  
  397.  |&1 Stack
  398.     winarrange(1)
  399.  &2 Arrange
  400.     winarrange(2)
  401.  &3 Arrange in Rows
  402.     winarrange(3)
  403.  &4 Arrange in Columns
  404.     winarrange(4)
  405.  _&5 (w/o CP) Stack
  406.     winiconize("")
  407.     winarrange(1)
  408.  &6 (w/o CP) Arrange
  409.     winiconize("")
  410.     winarrange(2)
  411.  &7 (w/o CP) Arrange in Rows
  412.     winiconize("")
  413.     winarrange(3)
  414.  &8 (w/o CP) Arrange in Cols
  415.     winiconize("")
  416.     winarrange(4)
  417.  _Change &Wallpaper
  418.        DirChange(FilePath(FileLocate("WIN.INI")))
  419.        a=FileItemize("*.BMP")
  420.        a=ItemSelect("Select New Wallpaper",a," ")
  421.        terminate(a=="","Wallpaper","No wallpaper selected")
  422.            tile=@FALSE
  423.            if FileSize(a)<40000 then tile=@TRUE  
  424.            ;if bmp size less than 40K, assume tile, else center
  425.            Wallpaper(a,tile)
  426.        drop(a,tile)
  427.  
  428.  
  429. &Main
  430.  &Command Post (2nd Window)
  431.     ErrorMode(@OFF)
  432.     a=WinActivate(TitleFirst)
  433.     b=WinActivate(TitleSecond)
  434.     ErrorMode(@CANCEL)
  435.     if (a&b) then goto PLACETHEM
  436.     DirChange(CPDIR)
  437.     run("cmdpost.exe","")
  438.     drop(a,b)
  439.     Exit
  440.     :PLACETHEM
  441.     WinPlace(0,0,500,@ABOVEICONS,TitleFirst)
  442.     WinPlace(500,0,1000,@ABOVEICONS,TitleSecond)
  443.     drop(a,b)
  444.  
  445.  
  446.  Control &Panel
  447.     errormode(@off)
  448.     terminate(winactivate("Control Panel"),"","")
  449.     errormode(@cancel)
  450.     run("control.exe","")
  451.  
  452.  C&lipboard
  453.     errormode(@off)
  454.     terminate(winactivate("Clipboard"),"","") ;Already Running
  455.     errormode(@cancel)
  456.     run("Clipbrd.exe","")
  457.  
  458.  &DOS Prompt
  459.     run(Environment("COMSPEC"),"")
  460.  
  461.  _Get &Help Cardfile
  462.        run("cardfile.exe","%CPDIR%cp_help.crd")
  463.  Get &Question 'n' Answer Cardfile
  464.        run("cardfile.exe","%CPDIR%cp_quest.crd")
  465.  
  466.  Reset &Options...
  467.     :NEXTOPTION
  468.     a="Blanker Options|Window Position|Printer Reset|Floppy Reset|Hard Drive Reset|Window Titles"
  469.     a=ItemSelect("Choose Option to Reset",a,"|")
  470.     if a=="Blanker Options" then goto BLANKER
  471.     if a=="Window Position" then goto POSITION
  472.     if a=="Printer Reset" then goto INFORESET
  473.     if a=="Floppy Reset" then goto INFORESET
  474.     if a=="Hard Drive Reset" then goto INFORESET
  475.     if a=="Window Titles" then goto WINTITLES
  476.     Exit
  477.  
  478.     :BLANKER
  479.     a=iniread(CP,"BlankTime",5)
  480.     b1="Enter screen blanker delay time"
  481.     b2="or 0 to disable blanker"
  482.     b3="or negative time to disable clock"
  483.     b4="or 9999 to eliminate it altogether"
  484.     b1=strcat(b1,crlf,b2,crlf,b3,crlf,b4)
  485.     a=AskLine("Screen Blanker",b1,iniread(CP,"BlankTime",5))
  486.     iniwrite(CP,"BlankTime",a)
  487.     ErrorMode(@OFF)
  488.     WinClose("CmdPost Clock")
  489.     ErrorMode(@CANCEL)
  490.     if a!=9999 then run("%CPDIR%CP_BLNK.EXE",a)
  491.     goto NEXTOPTION
  492.  
  493.     :POSITION
  494.     b1="Do you wish to save the current CmdPost"
  495.     b2="window position for future startups?"
  496.     b1=strcat(b1,crlf,b2)
  497.     a=AskYesNo("CmdPost Window Position",b1)
  498.     if a==@YES then IniWrite(CP,"WinPosition",WinPosition(""))
  499.     goto NEXTOPTION
  500.  
  501.     :INFORESET
  502.     if a!="Printer Reset" then goto INFORESET2
  503.     iniwrite(CP,"TextPrinter","ASK")
  504.     MenuChange("FilePrint",@ENABLE)
  505.     Goto INFORESET9
  506.  
  507.     :INFORESET2
  508.     if a!="Hard Drive Reset" then goto INFORESET3
  509.     iniwrite(CP,"LastDrive","ASK")
  510.     Goto INFORESET9
  511.     :INFORESET3
  512.  
  513.     iniwrite(CP,"DriveA","ASK")
  514.     iniwrite(CP,"DriveB","ASK")
  515.     
  516.     :INFORESET9
  517.     b1="CmdPost's saved information reset."
  518.     b2="You will be prompted to re-enter the"
  519.     b3="necessary information when it is required."
  520.     b1=strcat(b1,crlf,b2,crlf,b3)
  521.     Message("Information Reset",b1)
  522.     goto NEXTOPTION
  523.  
  524.     :WINTITLES
  525.     b1=AskLine("First CmdPost Title","Enter name of main CmdPost window.%crlf%Must be licensed  for this to work.",TitleFirst)
  526.     b2=AskLine("Second CmdPost Title","Enter name of other window.%crlf%Must be different!",TitleSecond)
  527.     if (StrIndex(b1,b2,0,@FWDSCAN)+StrIndex(b2,b1,0,@FWDSCAN))==0 then goto TITLEOK
  528.     Message("WinTitle","The two titles MUST be completely different.")
  529.     goto WINTITLES
  530.     :TITLEOK
  531.     iniwrite(CP,"TitleFirst",b1)
  532.     iniwrite(CP,"TitleSecond",b2)
  533.     if WinExist(TitleFirst) then WinTitle(TitleFirst,b1)
  534.     if WinExist(TitleSecond) then WinTitle(TitleSecond,b2)
  535.     TitleFirst=b1
  536.     TitleSecond=b2
  537.     drop(b1,b2,b3)
  538.     goto NEXTOPTION
  539.  
  540.        
  541.  _&System Information
  542.     run("%CPDIR%cp_info.exe","")
  543.  
  544.  |P&rogram Manager
  545.     errormode(@off)
  546.     terminate(winactivate("Program Manager"),"","") ;Already Running
  547.     errormode(@cancel)
  548.     run("Progman.exe","")
  549.  
  550.  &File Manager
  551.     errormode(@off)
  552.     terminate(winactivate("File Manager"),"","") ;Already Running
  553.     errormode(@cancel)
  554.     run("winfile.exe","")
  555.  
  556.  Print &Manager
  557.     run("printman.exe","")   ; takes care of itself
  558.  
  559.  &Windows Setup
  560.     a=FilePath(Filelocate("system.ini"))
  561.     run(strcat(a,"setup.exe"),"")
  562.     drop(a)
  563.  
  564.  
  565.  _&Edit CmdPost menus
  566.        DirChange(FilePath(FileLocate("%CPDIR%CMDPOST.CPM")))
  567.        a=FileItemize("*.CPM")
  568.        a=ItemSelect("Select menu to edit",a," ")
  569.        terminate(a=="","Edit","No file selected")
  570.        ;it it already running???  Find it...
  571.        ErrorMode(@OFF)
  572.        terminate(WinActivate("Notepad - %a%"),"","") ;Already being edited
  573.        bak=strcat(FileRoot(a),".BAK")
  574.        FileCopy(a,bak,@FALSE)
  575.        run("notepad.exe",a)
  576.        drop(a,bak)
  577.  
  578.  Edit &INI files
  579.        DirChange(FilePath(FileLocate("WIN.INI")))
  580.        a=FileItemize("*.INI")
  581.        a=ItemSelect("Select INI file to edit",a," ")
  582.        terminate(a=="","Edit","No file selected")
  583.        drop(NotWin2,b)
  584.        ;it it already running???  Find it...
  585.        ErrorMode(@OFF)
  586.        terminate(WinActivate("Notepad - %a%"),"","") ;Already being edited
  587.        bak=strcat( FileRoot(a),".BAK")
  588.        FileCopy(a,bak,@FALSE);
  589.        run("notepad.exe",a)
  590.        drop(a,bak)
  591.  
  592.  Edit System Confi&guration
  593.        run("sysedit.exe","")  ;takes care of itself
  594.  
  595.  PIF Edi&t...
  596.     a=strupper(FileExtension(CurrentFile()))
  597.     if a!="PIF" then goto PIF2
  598.     run("pifedit.exe",CurrentFile())
  599.     exit
  600.     :PIF2
  601.     if IsKeyDown(@SHIFT)==@NO then goto GENERICPIF
  602.     a=FileItemize("*.PIF")
  603.     a=ItemSelect("Choose a PIF File to edit",a," ")
  604.     run("pifedit.exe",a)
  605.     exit
  606.     :GENERICPIF
  607.     DirChange(FilePath(FileLocate("_default.pif")))
  608.     run("pifedit.exe","")
  609.     drop(a,b)
  610.  
  611.  
  612.  
  613.  
  614.     
  615.