Computing.Net > Forums > Programming > Help in creating a batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Help in creating a batch file

Reply to Message Icon

Name: Shane30
Date: September 3, 2009 at 21:18:52 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

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,
Shane



Sponsored Link
Ads by Google

Response Number 1
Name: Wahine
Date: September 4, 2009 at 00:17:07 Pacific
Reply:

In which environment?


0

Response Number 2
Name: Shane30
Date: September 4, 2009 at 00:29:03 Pacific
Reply:

windows XP and vista.


0

Response Number 3
Name: IVO
Date: September 4, 2009 at 04:14:46 Pacific
Reply:

You can't use a batch script to modify persistently the Windows XP/Vista environment.


0

Response Number 4
Name: Razor2.3
Date: September 4, 2009 at 06:31:45 Pacific
Reply:

If you don't mind downloading something, use the program setx


0

Response Number 5
Name: Judago
Date: September 4, 2009 at 07:47:52 Pacific
Reply:

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
HKEY_CURRENT_USER\Environment

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.


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

Script works but misses a... long folder names make fi...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Help in creating a batch file

Help for create a batch file www.computing.net/answers/programming/help-for-create-a-batch-file/15796.html

create a batch file www.computing.net/answers/programming/create-a-batch-file-/18104.html

Need help in creating multiple files using ba www.computing.net/answers/programming/need-help-in-creating-multiple-files-using-ba/19001.html