batch file variable

R

Richard

Hi

I used a batch file to set a variable. It works on the batch file but the
variable is not saved in the computer. For eg. I run a batch file setting
the variable:

set ipaddress=192.168.168.168

and run it. When I open the command prompt, and type set, the variable does
not appear. I was planning to use a batch file to set a variable and use the
variable at another time.

How do I save a variable in a batch file? Many thanks in advance.

Richard
 
P

Pegasus \(MVP\)

Richard said:
Hi

I used a batch file to set a variable. It works on the batch file but the
variable is not saved in the computer. For eg. I run a batch file setting
the variable:

set ipaddress=192.168.168.168

and run it. When I open the command prompt, and type set, the variable does
not appear. I was planning to use a batch file to set a variable and use the
variable at another time.

How do I save a variable in a batch file? Many thanks in advance.

Richard

Every process inherits its environmental variables from its
parent. When the process is closed, these variables are lost.
They are not passed back to the parent.

You have two options to set variables globally:
setx.exe (Win2000 Resource Kit)
setenv.exe (ftp://barnyard.syr.edu/pub/vefatica/setenv.exe)
 
R

Richard

Many thanks

Pegasus (MVP) said:
Every process inherits its environmental variables from its
parent. When the process is closed, these variables are lost.
They are not passed back to the parent.

You have two options to set variables globally:
setx.exe (Win2000 Resource Kit)
setenv.exe (ftp://barnyard.syr.edu/pub/vefatica/setenv.exe)
 

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