Computing.Net > Forums > Disk Operating System > Batch file - variables in programs

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file - variables in programs

Reply to Message Icon

Name: JSMP
Date: May 17, 2003 at 10:17:45 Pacific
OS: WINDOWS ME
CPU/Ram: Pentuim IV 1.4GHz / 256 M
Comment:

I cant make it set a variable. It says out of environment space. Also, how do you access the varible in other programs. Thanks!!!



Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: May 17, 2003 at 11:11:27 Pacific
Reply:

You gotta enlarge the environment space.

If you want to have more environment space for your day-by-day use, do the following:

1. Right click on the shortcut you use for opening the DOS window under WinME
2. Click on "properties"
3. Go to the "program" tab
4. There should be a field "command line" with the value "C:\WINDOWS\COMMAND.COM" or something similar. Add the string " /e:4096" on the end of that value (notice the space before the string, which will separate the original string from the switch). That will make the environment space on the command prompt to be 4KB. If it's still not enough, increase the number on that /e switch.

PS: I'm taking as base Win98SE, trusting that the shortcut layout is similiar in Win98SE and WinME. If an instruction doesn't seem to be possible of accomplishing, look for something similar.

But if the contest is a batch file meant for distribution and which is using too much environment space, it's no good to have each user of the batch script to follow those steps. So, here's a way to enlarge the environment space from the batch file itself:

@echo off
if "%1"=="GoTo" goto %2
%comspec% /e:4096 /c %0 GoTo start
goto eof
:start

echo From now to the end of the script,
echo you have 4KB of environment space!

:eof

You wrote:
> how do you access the varible in other programs

I don't know what you mean by that. The value of a variable is used on the command prompt like %MyVariableName% (that would represent the value of the variable "MyVariableName").

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br

___________________________________________________________


0

Response Number 2
Name: bitbyte
Date: May 17, 2003 at 15:39:52 Pacific
Reply:


in the most higher languages you have a function like GETENV() or OS-ENV()

or read it by our self with INT 21h and function 52h


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch file - variables in programs

Batch File Variables www.computing.net/answers/dos/batch-file-variables/7151.html

Batch file probs in W2k and XP www.computing.net/answers/dos/batch-file-probs-in-w2k-and-xp/8341.html

Batch File Variables Troubles www.computing.net/answers/dos/batch-file-variables-troubles/14028.html