|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming | |
Winblows Environment Variables
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | |||||||||||||
|
Commodore 64
|
Ok, I have bzip2 for Windows and I wanted to make my own WinRAR SFX installer. That's the easy part.
I want to have a batch file or script of some-sort to permanently modify the PATH variable to append %systemdrive%\bzip2\bin on the end of it. Everything I've half-assed researched brought up doing it manually in the sysdm.cpl or using set PATH=%PATH%;%systemdrive%\bzip2\bin which only stays useful for the current cli session. Any help would be greatly appreciated.
__________________
Google Talk: davyn.hauk My FAQ OLD Rig: Athlon XP-M 2600+ Barton, ABIT NF7-S v2, Corsair VS 512MB DDR400×2, AthenaPower 450W PSU, Sapphire Radeon 9600 256MB AGP
|
|||||||||||||
|
|
|
|
|
#2 (permalink) | ||||
|
Overclocker
|
Hi,
__________________I know you can do it within Windows using code but if you want to use a batch file then you can use the setx.exe utility. I think (from memory) it came with the resource kit but I am reasonably sure it can be downloaded (feel free to correct me here). Also, I think it can be done with kixtart, or a vbs script. If nobody else can answer it off the top of their head I am sure I can track something down in one of the other languages . . . Take care Rhys
|
||||
|
|
|
|
|
#3 (permalink) | |||||||||||
|
<3 TB303
![]() |
Right click on "my computer", go to "properties", go to "advanced", go to "environment variables", and add the appropriate variable.
__________________EDIT: oho, it has to be automated. ignore this post.
Last edited by Xaimus : 07-06-05 at 12:03 PM. |
|||||||||||
|
|
|
|
#4 (permalink) | |||||||||||
|
Lord of the Chicken Wings
![]() |
You need to change a registry key. The PATH is stored in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\Environment\Path. If you want the change to take effect immediately without a reboot, then you need to send a WM_SETTINGCHANGED Windows API message to the system to tell it to reread the registry.
I found some Delphi code on the web that explains the process, I'm sure you can translate it into whatever language you are using. http://bdn.borland.com/article/0,1410,28254,00.html
__________________
Vulcan Dragon Core i7 920 @ 3.8 GHz Currently Playing: Grand Theft Auto 4 (X360); Rock Band 2 (X360); Far Cry 2 (PC) XBox Live Gamertag: Vulcan Draggon
|
|||||||||||
|
|
|
|
#5 (permalink) | |||||||||||||
|
Commodore 64
|
Wow. I was kinda lost by that, so I downloaded a trial of Wise for Windows Installer and made a MSI installer package.
Thanks for the info.
__________________
Google Talk: davyn.hauk My FAQ OLD Rig: Athlon XP-M 2600+ Barton, ABIT NF7-S v2, Corsair VS 512MB DDR400×2, AthenaPower 450W PSU, Sapphire Radeon 9600 256MB AGP
|
|||||||||||||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|