Environment variable in each session

  • Thread starter Thread starter Blue Fish
  • Start date Start date
B

Blue Fish

Hello:

In the Windows 2003 Server, does each DOS Prompt can share the
Environment variable that created in each session?

Thanks!
 
Blue Fish said:
Hello:

In the Windows 2003 Server, does each DOS Prompt can share the
Environment variable that created in each session?

Thanks!

No.

Each instance of CMD.EXE has its own individual set of environment
variables.
 
Hello:

It was not related to academic studies, I am writing a batch which will
call by many external batches at the same time. If they are using the
same value event different DOS Prompt, my batch will have problem.

Thanks You!
 
It was not related to academic studies, I am writing a batch which will
call by many external batches at the same time. If they are using the
same value event different DOS Prompt, my batch will have problem.

Thanks You!

The use the %random% environment variable to create a variable. If it is being
used to create a name for a temporary file then check the existance of the file
and loop to get a new value:

@echo off
:loop
set value=%random%.txt
if exist "%temp%\%value%" goto :loop
 
The use the %random% environment variable to create a variable. If it is being
used to create a name for a temporary file then check the existance of the file
and loop to get a new value:

@echo off
:loop
set value=%random%.txt
if exist "%temp%\%value%" goto :loop

Amazing! I had no idea about this "environment variable". Are there
other special ones like this (that behave like functions)?

Csaba Gabor from Vienna
 
Csaba Gabor said:
Amazing! I had no idea about this "environment variable". Are there
other special ones like this (that behave like functions)?

Csaba Gabor from Vienna

If you mean %random% then there are a few. They're listed at the end of the
SET documentation, accessible at the prompt from

SET /?

(which you probably already knew)
 
Back
Top