Environment variable in each session

B

Blue Fish

Hello:

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

Thanks!
 
B

billious

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.
 
B

Blue Fish

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!
 
F

foxidrive

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
 
C

Csaba Gabor

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
 
B

billious

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top