Personal Help File

This is a .BTM that allows me to keep notes, and display them, at the Take Command Console.

I have attached myhelp.zip, which is a sample database of a few notes.

Your notes can be added to the database, deleted from the database, modified, etc.

This is a work in progress, so feel free to copy the .btm, and make changes to the source to fit your needs.

I use the 7-Zip File Manager (7zFM.exe) to manage the myhelp.zip file (database).

Start out by running the program with the contents argument;
Code:
e:\utils>myhelp contents
2022-03-17  07:13            228   29%  32odbc.tcc.btm
2022-03-17  07:15            228   25%  32RegSvr.tcc.btm
2022-03-17  06:46            155   19%  4desc.tcc.btm
2022-03-17  08:00          5,151   55%  del.tcc.btm
2022-03-17  08:02          3,657   68%  forfiles.tcc.btm
2022-03-17  08:53          1,293   57%  more.tcc.btm
2022-03-17  07:29            893   52%  RegSvr32.tcc.btm
2022-03-17  07:29          1,195   53%  regsvr42.tcc.btm
2022-03-17  06:23          1,598   46%  start.tcc.btm
2022-03-17  07:57            738   46%  SysExp.tcc.btm
...to see what is in the database.

Now, I want to see my notes for start, so;
Code:
myhelp start
...shows me my notes for start.

As we know, the TCC Command Line Help lacks much of what is in the TCC Help File, (start /?) and that the TCC Help File has much more detail.

With my Personal Help File, I can now get more detailed help about Start at the command line.

Joe

Code:
:: This .btm allows me to view the help notes I have created for commands on my system.
::
:: The database is a ZIP file, myhelp.zip, which contains the help notes.
::
:: I create a text file, for example, start.tcc.btm (find the contents of start.tcc.btm at the bottom of this .btm)
::
:: Once I have the text file completed, I ZIP it into the myhelp.zip file.
::
:: You don't have to use ZIP. You can use one of the other TCC archivers if you want. (7ZIP, TAR, etc.)
::
@setlocal
@echo off
::
:: The location of the myhelp.zip file.
::
set myhelp=e:\utils\myhelp.zip
::
:: The un-archiver I am using
::
set unzip=unzip

:: Make sure that myhelp.zip exists.
::
iff not exist %myhelp then
  echo Could not find %myhelp
    quit
endiff

:: No argument was entered from the command line, so display usage.
::
iff %# eq 0 then
  echo USAGE: %_batchname contents
    echo        %_batchname command
    echo        %_batchname @function
    quit
endiff

:: Extract the contents of the myhelp.zip file to contents.txt
:: /V View the list of files in the archive (date, time, size, compression ratio, and filename).
::  If the zip file is password protected, UNZIP will append a * after the filename. 
::
%unzip %myhelp /v > %temp\contents.txt
::
:: Display the contents of the myhelp.zip file. 
::
iff %1 eq contents then
  if exist %temp\contents.txt type %temp\contents.txt | more.com
  quit
endiff
::
:: Look for the note that was entered as an argument on the command line.
::
ffind /kvmt"%1.tcc.btm" %temp\contents.txt > nul
::
:: Save the number of files found.
::
set ffind_matches=%_ffind_matches
::
:: If the contents.txt file exists, delete it quietly, not needed anymore.
::
if exist %temp\contents.txt del /q %temp\contents.txt
::
:: If the file for the command we want does not exist in myhelp.zip...
::
iff %ffind_matches eq 0 then
  echo Could not find %1
    quit
endiff

:: UNZIP the file from myhelp.zip for the command that we want.
::
:: /C Display (on standard output) the contents of a file in the zip archive. 
:: /O Overwrite existing files. UNZIP normally prompts before overwriting an existing file; /O will suppress the prompt. 
::
%unzip %myhelp /c /o %1.tcc.btm > %temp\%1.tcc.btm

:: If the extraction of the file was successful...
::
iff exist %temp\%1.tcc.btm then
  ::
    :: Display the requested help page.
    ::
  gosub "%temp\%1.tcc.btm" HelpText
else
  echo Could not find %temp\%1.tcc.btm
endiff

:: If the requested help page file exists, delete it quietly, not needed anymore.
::
if exist %temp\%1.tcc.btm del /q %temp\%1.tcc.btm

endlocal
quit

:: The contents of the start.tcc.btm file
::
:: Note that I am using the TCC internal list command to display the contents of the file.
::  You can use whatever viewer you desire. Just replace *list with your viewer.
::  For example, using more.com will display a page at a time.
::
:HelpText
TEXT | *list
Start a program in another session or window.

START ["title"] [/= /AFFINITY=n /ABOVENORMAL /BELOWNORMAL /BREAKAWAY /COLOR=BF /DESKTOP=name /ELEVATED /FEEDBACK=off|on
    /HIGH /LOW /JOB=jobname /NOPINNING /NORMAL /PARENTAFFINITY /REALTIME /B /C /K /Dpath /I /INV /MAX /MIN /NODE n
    /POS=x,y,width,height /L /LA /LD /LF /LH /MONITOR=n /RUNAS user password /SIZE=rows,cols /TAB /TABNA /WAIT /WIN
    /PGM ]
    "progname" [command]

title        Title to appear on title bar
path        Startup directory
progname    Program name (not the session name)
command        Command to be executed by progname

/ABOVENORMAL    Priority
/LF        Local functions
/AFFINITY    Multiple CPUs
/LH        Local history list
/B        No new console
/LOW        Priority
/BELOWNORMAL    Priority
/MAX        Maximized window
/BREAKAWAY    Break away from job
/MIN        Minimized window
/C        Close when done
/MONITOR    Monitor to use
/COLOR        Default console colors
/NODE        NUMA node
/D        Startup directory
/NOPINNING    Don't pin to taskbar
/DESKTOP    Start desktop
/NORMAL        Priority
/ELEVATED    Start as admin
/PARENTAFFINITY    Inherit parent's affinity
/FEEDBACK    Cursor feedback mode
/PGM        Program name
/HIGH        Priority
/POS        Position of window
/I        Inherit environment
/REALTIME    Priority
/INV        Invisible window
/RUNAS        Run as other user
/JOB        Start process in job
/SIZE        Screen buffer size
/K        Keep when done
/TAB        Start in Take Command tab window
/L        Local lists
/TABNA        Start in inactive Take Command tab
/LA        Local aliases
/WAIT        For session to finish
/LD        Local directory history
/WIN         Windowed session
ENDTEXT
Return
 

Attachments

  • myhelp.zip
    7.7 KB · Views: 12

Similar threads