Printer Version Table of Contents Project Home Page
.TOPIC.......: How To Put Fdate Output Into An Environment Variable
.DISCUSSION..:

CALL A BATCH FILE

The most basic way to put Fdate's output into an environment variable, although not the most convenient, is to:

         Fdate /Ff /Atoday /O"mn zd, ccyy" /P"@SET Fdate=" >JUNKTEMP.BAT
         call JUNKTEMP.BAT
         del  JUNKTEMP.BAT

USE AN ENVIRONMENT-MANIPULATION UTILITY

There are shareware and freeware utilities that are written specifically to manipulate environment variables. Fdate's output can be put into an environment variable by piping it to one of these utilities.

For older, DOS-based systems, Bob Stephan's GET and PC Magazine's STRINGS are excellent choices.

If you are running Windows NT, Windows 2000, or Windows XP, see TOPIC Xset - A Utility For Creating Environment Variables Under NT, Win2k, XP


Fdate's /V PARAMETER

Starting with version 6.1, Fdate supports a /V (environment variable) parameter. A user can use /V to tell Fdate to put its output directly into an environment variable in the parent environment. For example:

              Fdate /Ff /VDATE1
will set the environment variable DATE1 to the current date. If you type SET at the DOS prompt, you should see something like:

              DATE1=Friday February 14, 1992
If you specify /V without an evar name, the evar name defaults to Fdate.

   Example :       Fdate /Ff /V
   produces:       Fdate=Friday February 14, 1992

Fdate's /V PARAMETER CAN NOT ALWAYS BE USED

NOTE HOWEVER that the /V parameter WILL NOT WORK under Windows NT, Win2k, or XP. see TOPIC Problem - /V Does Not Work Under NT, Windows2000, XP


There may be times when the /V parameter does not work under Win3x or Win9x. Sometimes it is possible to correct these problem situations. see TOPIC Problem - /V Does Not Work Under Win3X Or Win9X


In addition, due to the complexities of manipulating the environment, there may be other circumstances on older machines where /V doesn't work. These include running Fdate when you have shelled out to DOS from another program, have put the command processor in upper memory (UMB), are running under Carousel, etc. In such cases, you must use one of the more basic techniques described above.