batch file variable

  • Thread starter Thread starter Richard
  • Start date Start date
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
 
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)
 
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)
 
Back
Top