FULLSCREEN CONTENTS Project Home Page
.WINDOWS_USE.: Problem - /V Does Not Work Under Win3X Or Win9X
.ALIAS.......: v_under_windows
.DISCUSSION..:
Starting with Fdate version 8.4 -- thanks to a Turbo Pascal routine from the Turbo Professional library (see below) provided by Kim Kokkonen of TurboPower Software -- Fdate's /V parameter works even in a Windows DOS box, assuming you have enough environment space available.

The problem is that when you shell out to a DOS box under Windows, the size of the DOS environment is normally limited to the amount actually in use by DOS at the time when you first started Windows (rounded up to multiples of 16). In short, when you shell out to DOS under Windows, you have little or no free environment space left.

The trick to giving yourself a decent amount of environment space in a Windows DOS box, is to edit SYSTEM.INI and put the following line in the [NonWindowsApp] section:

[NonWindowsApp]
CommandEnvSize=1024

This tip is from Brian Livingston's "Windows 3.1 Secrets", p. 225. According to Livingston, "This command allocates 1,024 bytes of conventional memory to the environment space of each DOS session you start. (You can choose any value you want, but it should probably be a multiple of 16 bytes...)"

It's a good idea to be generous here, because the default prompt for a Windows DOS box (the one with the highlighted bar across the top of the screen) consumes a lot more environment space than the simple "$p$g" of the conventional DOS prompt.

An alternative technique, if you're running Windows 3.0 or earlier, is always to start Windows from a batch file that contains the following line, executed BEFORE you start Windows:

SET DUMMY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

This will reserve a chunk of environment space that will be copied into the environment in the Windows DOS box. Then, as one of the first statements in any batch file that you run under Windows, put

SET DUMMY=

This will free up the environment space used by all those "X"s.

For a good treatment of running DOS apps under Windows, including a discussion of the environment, I recommend Brian Livingston's WINDOWS 3.1 SECRETS, chapter 7.