Help in creating a batch file

September 3, 2009 at 21:18:52
Specs: Windows XP
I need to create a new environment variable and update an existing one using a batch file.

Any help will be highly appreciated..

Thanks and regards,

See More: Help in creating a batch file

Report •

September 4, 2009 at 00:17:07
In which environment?

Report •

September 4, 2009 at 00:29:03
windows XP and vista.

Report •

September 4, 2009 at 04:14:46
You can't use a batch script to modify persistently the Windows XP/Vista environment.

Report •

Related Solutions

September 4, 2009 at 06:31:45
If you don't mind downloading something, use the program setx

Report •

September 4, 2009 at 07:47:52
It is possible to create or modify environment variables using reg.exe(available in most xp machines not so sure about vista), there is however a catch, the variables aren't loaded until the next reboot(or possibly if another program broadcasts a WM_SETTINGSCHANGE, even then it won't be available to existing shells and is highly unlikely).

One of the keys is

or <userhive>\Environment

All of the global variables seem to be accessable from:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

Values are the variable names and their data is what the variable expand to.

Report •

Ask Question