home *** CD-ROM | disk | FTP | other *** search
- echo off
- CLS
- Echo This is a DEMO for TMES -- The Master Environment SET
- Echo The program TMES.EXE is copyrighted 1993 by Tee Roper
- Echo =====================================================
- Echo.
- Echo This Batch file was created so you can see how to use TMES
- Echo by just enjoying the DEMO "show." I hope you like what you see.
- Echo.
- Echo TMES adds versatility to the area of your PC that you don't
- ECHO normally use for much, the Environment Area. This utility
- Echo may change your ideas about its use.
- Echo.
- Echo Enjoy this TMES DEMO. Tee
- Echo.
- Echo.
- Echo.
- Echo.
- Echo.
- Echo.
- Echo.
- Echo.
- pause
- CLS
- Echo.
- Echo ---- Before we start, let me test your Environment space to see -----
- Echo ------------ if you have enough room to run the DEMO ----------------
- Echo.
- Echo I will test your environment for its size.
- Echo I'll be using TMES to check it, too.
- Echo - so here goes -
- Echo TMES BYTLF /ELEFT
- TMES BYTLF /ELEFT
- Echo (it just ran)
- Echo this one line above sets the variable BYTLF to the number of BYTes LeFt in your
- Echo environment space which you have now. Remember the Variable name "BYTLF".
- Echo Now I will see how large it really is....wait a second while I do some math!
- Echo TMES SIZE /ESIZE
- TMES SIZE /ESIZE
- Echo TMES X %%BYTLF%%
- TMES X %BYTLF%
- ECHO TMES X /mul 100 (we're doing Integer Math here, so, X times 100)
- TMES X /mul 100
- Echo TMES X /div %%SIZE%%
- TMES X /DIV %SIZE%
- Echo Whew!
- Echo (if you're running this DEMO on a floppy disk, it's slow, I'm sorry!)
- Echo.
- Echo Your Environment will hold %SIZE% bytes,... so your space is %X% %% occupied.
- Echo.
- Pause
- CLS
- Echo.
- Echo You have %BYTLF% bytes REMAINING in your Environment space (%%BYTLF%%).
- Echo.
- Echo Most people, today, have increased their Environment size.
- Echo.
- Echo TMES may make you re-think how big you want it now. You can
- Echo do it in your CONFIG.SYS file in just one line. For example,
- Echo I run DOS version 5.0 and my CONFIG.SYS has this line in it:
- Echo.
- Echo SHELL C:\COMMAND.COM C:\ /E:800 /P /F
- Echo.
- Pause
- CLS
- Echo.
- Echo SHELL C:\COMMAND.COM C:\ /E:800 /P /F
- Echo (It's the /E:800 part which sets the Environment space)
- Echo.
- Echo Check your own version of DOS to see how to do it on/in YOUR VERSION.
- Echo In my example above, I have 800 bytes allocated for my environment.
- Echo.
- Echo TMES BYTLF /LT 100 ANS
- Echo (asks if the variable "BYTLF" is less than 100, result goes into ANS)
- TMES BYTLF /LT 100 ANS
- :: the logical 0 or 1 goes into the ANS variable
- ::
- Echo.
- Echo I know that you have exactly %BYTLF% bytes left....
- if '%ANS%'=='1' Echo ....and so, watch this DEMO carefully, since you don't have much Environment
- if '%ANS%'=='1' Echo Space left. I need about 50 bytes from time to time.
- if '%ANS%'=='0' Echo ...and so, great!, since you have more than 100 bytes of Environment left.
- Echo.
- pause
- CLS
- ::
- tmes /del ANS BYTLF X SIZE
- ::****delete some************
- ::
- Echo.
- Echo TMES will run many times during this DEMO to SET your Environment.
- Echo If your Environment area were set up to hold 2000 bytes, it could
- Echo be more useful than a 2K TSR I'll bet. Think about it, please.
- Echo.
- Echo This DEMO will let you can see what TMES can do without having to dream up any
- Echo functions to test TMES yourself. I hope this DEMO will give you some
- Echo fresh ideas of how you could use TMES at Work....or at Home.
- Echo.
- Echo Here goes.......
- Echo.
- Pause
- CLS
- Echo.
- Echo This is the part of your current Environment which TMES operates within.
- Echo It is seen by issuing the normal DOS "SET" command - so, here goes...
- Echo ----------------------------------------------------------
- SET
- Echo ----------------------------------------------------------
- Pause
- CLS
- Echo.
- Echo Now TMES will set two variables: JJ and DD
- Echo DD will become the current Drive you're using here, and
- Echo the variable JJ will become free space left on the disk in the drive.
- Echo %%DD%% will be the Drive letter used, and %%JJ%% will be the free
- Echo space left on that drive in bytes. Any Ideas about Copying files?
- Echo.
- Echo Be sure to look at this Batch file after this DEMO is over.
- Echo.
- Echo I will now use TMES to set DD to the current drive, like A: or C:
- ECHO TMES DD /DRV
- TMES DD /DRV
- Echo (it's done...)
- Echo and now I will use TMES again to set JJ equal to the number of bytes
- Echo which are free (unused as yet) on this same Drive %DD%: of yours.
- ECHO TMES JJ /FREE
- TMES JJ /FREE
- Echo (it's done...)
- Echo Notice above that I now know what drive you're running this on, %DD%:
- Echo.
- pause
- CLS
- Echo.
- Echo Now, using the variables JJ and DD in the next line, I know that:
- Echo You have %JJ% bytes free on %DD%: - that fact could be useful to know.
- Echo.
- Echo These two functions, ie /FREE and /DRV could be used to decide
- Echo whether or not you have enough room on a diskette to do a copy
- Echo or a back up, for instance. If you didn't have enough room, you
- Echo could tell the user to insert another diskette. It's a new game now
- Echo with TMES at your side. Write your own Utilities. Customize easily.
- Echo.
- Echo Let's learn how to use a couple more of the forty (40) switches
- Echo available for you. Let's use /YEAR4 and then /LE after that.
- Echo The /YEAR4 switch will get the current Year in four digits, and
- Echo then the /LE will use boolean logic to test whether the year is less
- Echo than or equal to 1994. It looks at your system date, FYI.
- Echo.
- Echo TMES gives you a new programming ability in your Environment Area!
- Echo.
- Echo Deleting the variables JJ and DD since we won't use them again.
- Echo TMES /del JJ DD
- tmes /del JJ DD
- ::***delete some**********
- ::
- Echo.
- PAUSE
- CLS
- Echo.
- Echo Here goes...let's get the Year and then test it!
- Echo.
- Echo TMES YR /YEAR4
- TMES YR /YEAR4
- Echo TMES YR /LE 1994 X
- TMES YR /LE 1994 X
- Echo TMES was just run twice...
- Echo.
- Echo I have %YR% for the Year and a one (1), or zero (0), for the result
- Echo of testing %YR% against the number 1994. If the date is Less Than
- Echo or Equal to the year 1994, then this number will be a 1.
- Echo.
- Echo If you run this DEMO in the year 1995 or afterwards, then the result will
- Echo be a zero.
- Echo.
- Echo Here's the result: it's a %X%....
- Echo.
- Pause
- CLS
- Echo.
- Echo So, we can write a small amount of "IF" code like we do in Assembly
- Echo or Basic or Pascal or whatever language you know.....
- if '%X%'=='1' goto no
- Echo The current year %YR% is Greater than 1994. Where did you get this?
- Echo ---------------------- Get a "Fresher" Copy ------------------------
- Echo There are a lot of TMES versions you have missed. TMES was first
- Echo created in the year 1993. There's no time bomb, however, so enjoy!
- Echo Tee Roper, author
- Echo.
- goto ennd
- ::
- :no
- Echo The Current year "%YR%" -----is either "1993" or "1994", and
- Echo so, you have a relatively fresh copy of TMES. Enjoy its use in your
- Echo system. Write me with new ideas for future versions. Thanks.
- Echo Tee Roper, author
- Echo.
- :ennd
- Pause
- CLS
- Echo.
- ::
- Echo Deleting a couple of variables.
- ECHO TMES /del ANS X
- tmes /del ANS X
- ::****delete some************
- ::
- :topofinput
- Echo.
- Echo Now, Please Enter Your Name, using Normal UPPER and lower case letters
- TMES NAME /INPUT
- if '%NAME%'=='' Echo Come on, you didn't enter a name... I watched you.
- if '%NAME%'=='' goto topofinput
- Echo.
- Echo Getting the Day of Week, the Month's number, and the Day of the month
- Echo.
- Echo TMES WEEKDAY /DOW
- TMES WEEKDAY /DOW
- ::
- Echo TMES MONF /MONTH
- TMES MONF /MONTH
- ::
- Echo TMES DY /DOM
- TMES DY /DOM
- Echo.
- Echo (TMES was just run 3 times, %NAME%.)
- Echo.
- Pause
- CLS
- Echo.
- Echo Thanks, %NAME%, for trying TMES today which is #%DY% on a
- if '%WEEKDAY%'=='0' Echo Sunday in the Month #%MONF% of the Year %YR%.
- if '%WEEKDAY%'=='1' Echo Monday in the Month #%MONF% of the Year %YR%.
- if '%WEEKDAY%'=='2' Echo Tuesday in the Month #%MONF% of the Year %YR%.
- if '%WEEKDAY%'=='3' Echo Wednesday in the Month #%MONF% of the Year %YR%.
- if '%WEEKDAY%'=='4' Echo Thursday in the Month #%MONF% of the Year %YR%.
- if '%WEEKDAY%'=='5' Echo Friday in the Month #%MONF% of the Year %YR%.
- if '%WEEKDAY%'=='6' Echo Saturday in the Month #%MONF% of the Year %YR%.
- Echo There's more Date type functions. We'll use one more, so
- Pause
- CLS
- Echo.
- Echo TMES /del MONF NAME WEEKDAY YR DY (deleting some variables just used)
- TMES /del MONF NAME WEEKDAY YR DY
- ::*********delete some************
- Echo.
- Echo TMES THEDATE /DATE
- TMES THEDATE /DATE
- Echo I just Ran TMES to get the whole date at one time. That's easier than
- Echo putting together the three pieces, Year, Month, and Day.
- Echo.
- Echo /DATE produced a variable THEDATE which, today, is %THEDATE%.
- Echo.
- Echo I could write ONE batch file that backed up my data every day - and -
- Echo gave each file a new name made from the date on which it was run!
- Echo.
- Echo Let's use the /INPUT switch to get the name of the filespec to copy.
- Echo so, we would do this:
- Echo TMES FILEIN /INPUT
- Echo.
- Pause
- CLS
- Echo.
- Echo I'm doing it now as a "fake" input to make FILEIN = FILESPEC in this
- Echo DEMO program so you won't have to Input anything.
- Echo.
- Echo TMES FILEIN C:\UTIL\ALLNAMES.DBF
- TMES FILEIN C:\UTIL\ALLNAMES.DBF
- Echo.
- Echo I could have used DOS' SET to do this, as well, by typimg this:
- Echo SET FILEIN=C:\UTIL\ALLNAMES.DBF
- Echo.
- ::
- :: You can forget about SET if you have TMES.
- ::
- Echo Parsing what was input and using Z for a variable.
- Echo "Z" could be any other variable you want to use, but use Z now.
- Echo.
- Echo I will parse C:\UTIL\ALLNAMES.DBF for you in the next line.
- Echo.
- Echo TMES Z /PARSE C:\UTIL\ALLNAMES.DBF
- TMES Z /PARSE C:\UTIL\ALLNAMES.DBF
- :: the above line really works (using Z) so you can see the results below
- ::
- Echo.
- Pause
- CLS
- Echo.
- Echo We did a "TMES Z /PARSE C:\UTIL\ALLNAMES.DBF"
- Echo.
- Echo And each part of FILEIN is assigned to "ZD" or "ZP" or "ZN" or "ZE" !!!!
- Echo.
- Echo So, let's suppose we entered C:\UTIL\ALLNAMES.DBF (the one faked as INPUT!)
- Echo For instance, the above filespec would be broken down (parsed) by TMES
- Echo to yield ZD, ZP, ZN, and ZE which are the parts of the
- Echo The filespec we are working with, which is %FILEIN%
- Echo ZD is the Drive or %ZD% in this example.
- Echo ZP is the Path or %ZP%.
- Echo ZN is the Name of the file which is %ZN%, and finally,
- Echo ZE is the Extension which is %ZE% here.
- Echo ...Remember that No colons or periods are saved.
- Echo You can always add colons or periods later, if needed. It's cleaner.
- Echo.
- Pause
- CLS
- Echo.
- Echo Then I can put the 4 filespec "parts" back together using the double percents
- Echo like this: %ZD%:%ZP%\%ZN%.%ZE% made from this: %%ZD%%:%%ZP%%\%%ZN%%.%%ZE%%
- Echo so just look at this in this TMESDEMO.BAT file and you'll see that I
- Echo used the real variables here, not just names typed in.
- Echo.
- Pause
- CLS
- Echo.
- Echo And now, let's use these parts to make a Serialized Date Copy:
- Echo Here's what you would type into your "copy genius" BATCH file:
- Echo TMES FILEIN /input (you would input a filespec here to backup)
- Echo TMES THEDATE /date
- Echo TMES Z /parse %%FILEIN%%
- Echo :
- Echo COPY %%FILEIN%% %%ZD%%:%%ZP%%\BK%%THEDATE%%.%%ZE%%
- Echo :
- Echo : which is equivalent to writing the following line for today:
- Echo : COPY %FILEIN% %ZD%:%ZP%\BK%THEDATE%.%ZE%
- Echo.
- Echo When you run this same TMESDEMO.BAT tomorrow, the %%THEDATE%% below will change!
- Echo The system date creates this string variable: %THEDATE% for today!
- Echo.
- :: notice the addition of the colons and slashes and dots as needed!
- :: TMES assumes you would rather have "clean" variables to work with!
- ::-------
- Echo You would have a "Date Oriented" and "Serialized" file in the same place
- Echo on your harddrive. On each day you ran it, the FileCopyName would change!
- Echo.
- pause
- CLS
- Echo Here is your environment again. See the new TMES Variables?
- SET
- Pause
- CLS
- Echo.
- Echo and now I will erase the remaining TMES Variables with one line of code.
- Echo .....Just by doing "TMES /del FILEIN ZD ZN ZP ZE THEDATE"
- Echo.
- Echo Important:
- Echo Stop now with "Control-C" if you want to stop the Batch file from
- Echo deleting the TMES variables, ....else let's get rid of them.
- Echo.
- Pause
- CLS
- Echo.
- Echo TMES /del FILEIN ZD ZN ZP ZE THEDATE ANS
- TMES /del FILEIN ZD ZN ZP ZE THEDATE ANS
- ::***********delete a bunch*******************
- ::
- Echo (done, the TMESDEMO %%VARIABLES%% that we had created are gone now)
- Echo Here's your old "original" environment back.
- Echo ----------------------------------------------------------
- SET
- Echo ----------------------------------------------------------
- Pause
- CLS
- Echo.
- Echo That concludes the TMES DEMO batch file.
- Echo.
- Echo I hope you can find TMES useful enough to add to your DOS
- Echo subdirectory in your home and especially at work - hint, hint.
- Echo.
- Echo "Registration Thanks" from me and from my family. Tee Roper
- ::
- :: Please do not change this Batch file if you give it to others. Thanks. Tee
-