FULLSCREEN CONTENTS Project Home Page
.TOPIC.......: Nt - Using Fdate With Windows Nt
.ALIAS.......: NT
.DISCUSSION..:
Most of this material also appears in FDATE.TXT. I've duplicated it here in the hopes that it will catch the eye of potential NT users of Fdate.

=======================================================
ABOUT RUNNING FDATE UNDER WINDOWS NT
=======================================================

There are two problems that people commonly report when attempting to run Fdate under Windows NT. One is that they run out of environment space. The other is that the /V parm does not work, and Fdate's output is not be put into an environment variable

=======================================================
RE: "Out of environment space" under WinNT
=======================================================

I'm not an NT user (I use Win95), but one can encounter this same problem when running under Win95 (or even Win 3.1), so I will extrapolate from those problems.

This is a problem that may affect any process that runs in a "DOS box" under Windows, and sets an environment variable. It is discussed briefly in the the Fdate documentation (although with the advent of WinNT and Win95, that discussion is a bit dated). The problem is that when Windows launches COMMAND.COM, it allocates to the new process only the amount of environment space that is in use by the current environment. This does not give the launched process any free space that it can use for its own purposes, so when it tries to set an environment variable, you get the "out of environment space" message.

The trick is to tell Windows that when it starts the "DOS box" (COMMAND.COM), it should allocate a certain minimum amount of memory for the environment, regardless of the amount that is currently being used.

How to do it under Win95
=========================

Select the shortcut icon that you use to start MS-DOS. Right-click on it. When the pop-up menu appears, t click on PROPERTIES. When the properties for the shortcut come up, click on the MEMORY tab. When the tab sheet is displayed, set a value for INTITIAL ENVIRONMENT. I usually set it to 2048 (that is, 2K) bytes. This will ensure that when DOS (COMMAND.COM) is started, 2K bytes are allocated to the environment.

How to do it under WinNT
=========================

I'm not an NT user, so I don't know how to do this under NT, but I'm betting the process is similar. Try doing what I've described for Win95. Let me know how it works out. If you find that the process is different under NT than it is under Win95, it would be really helpful if you could e-mail me a description of the process that worked for you. Then I could forward it to anyone else who might ask me about the same problem in the future.

Unfortunately, Fdate's /V parm doesn't work under NT. Here is an excerpt from the FDATE documentation that discusses THAT issue....


=======================================================
/V DOES NOT WORK WHEN RUNNING FDATE UNDER WINDOWS NT
=======================================================

Early in 1996, reports began trickling in of users having difficulty with Fdate's /V feature (setting the value of an environment variable) when running under Windows NT. To make a long story short, in many cases, Fdate's /V feature doesn't work under Windows NT. Unfortunately, this situation cannot be corrected. Microsoft has never made it easy to access the environment programmatically, and the situation has become worse in Windows 95 and Windows NT. The situation has become so difficult that TurboPower Software, which markets add-on utilities, has withdrawn support for utilities that change environment variables. Since Fdate uses these utiltities, it is virtually certain that I will never be able to make Fdate's /V feature work under NT, in cases where it does not now work.

This does not mean, however, that Fdate can't be used with NT. What it means is that, when running Fdate under NT, we have to fall back on a more basic method of setting an environment variable. This involves creating a temporary batch file that sets the variable, then running and deleting the batch file. It's primitive, but it works.

CALL A BATCH FILE
=================

The most basic way to put FDATE's output into an environment variable, is to:

In this example, the result will be that the FDATE environment variable is set to today's date, in ccyymmdd format.

You might also want to investigate a utility called XSET. Try:
http://members.tripod.com/~marcstern/xset.htm
or http://www.bigfoot.com/~xset


.INFORMATION:

   ***********************************************
   *    XSET 5.29  : Extended SET Instruction    *
   *                                             *
   *       (C) 1991-1998 Stern Marc              *
   ***********************************************

Everything you always wanted to put in an environment variable
but were afraid to ask DOS, NT or OS/2 for . . .

        XSET: The easy way to write efficient batch files.

XSET allows you to put EVERYTHING you want  in  a  variable  of
the current environment and use it as if you had assigned it the
value  with the standard DOS command 'SET'. You will be able to
write very efficient batch files including string manipulation,
calculation, ...

XSET is the most powerful environment variable manipulation
program you have ever seen. It also has a very easy and intuitive
user interface (very close to the 'SET' command). It is not a
resident program;  so  it will not interfere with any of your
other applications.

XSET is fully compatible with MS-DOS (from 3.30),  DR-DOS,  NDOS,
4DOS, OS/2, Windows 95/98 and Windows NT.


    XSET has seven major features:
    -----------------------------

     - XSET permits you to catch the output  of  any  command  (internal  or
       external) or program and put it into an environment variable.

     - XSET has built-in commands to modify the output of  a  program  or  a
       string given on the command-line (extract a part of a string, ...)

     - XSET has a built-in full  floating-point  calculation  functionality:
       You can program incremental loops, input  a  calculation  string  and
       output the resulting number, ...

     - XSET can manage variable contents of more than 128  characters  (your
       path can now be as long as you want).

     - XSET has other built-in commands to give you access  to  some  system
       data (date, time, ...)

     - XSET has built-in commands to clear the whole environment or  restore
       a previously saved one.

     - XSET gives you  access  to  high-level  input/output  user  interface
       (line-editing, colors, windows, boxes, ...).


    Web:     http://members.tripod.com/~marcstern/xset.htm
           or http://www.bigfoot.com/~xset

     E-mail:  xset@bigfoot.com           (internet)
           or xset@writeme.com           (internet)
              >INTERNET:xset@bigfoot.com (compuserve)
           or >INTERNET:xset@writeme.com (compuserve)


     Marc Stern
     Av. de la Basilique 376 bte 19
     1081 Bruxelles
     Belgium

     Tel:  +32-2 427.98.52 ( after 18h Central European Time )