December 29, 200421 yr Is there a way to automate the addition of an entry to my path statement found under:Right-click "My Computer">Properties>Advanced>Environment VariablesUnder system variables is a "Path" entry. I'd like to add a dir to that and have it present on my unattended, out-of-the-box install... anyone?THANKS!
December 29, 200421 yr Path is saved in HKLM,SYSTEM\CurrentControlSet\Control\Session Manager\Environment.There is just one problem: You want to add something to the path, when you set path to a new value you would remove the entries that it's already set to. You have to look what the path is during setup and incorporate these folders in your .reg/.inf file.Or is there a way to add something to a registry value without replacing it?
December 29, 200421 yr Author Thanks for the info... maybe someone knows the answer to your question..?
December 29, 200421 yr SET PATH=%PATH%;NewEntryIs how you would append it in a batch script. Then use the REG command, and use the new PATH variable as the data to be imported.
January 2, 200521 yr Author So I should be able to do this in my batch_file.cmd:SET PATH=%PATH%;c:\gnupgAnd that should append the path to my current entry. Is that correct? I'm not clear on what to do with the REG command as you stated.Thanks!
January 2, 200521 yr So I should be able to do this in my batch_file.cmd:SET PATH=%PATH%;c:\gnupgAnd that should append the path to my current entry. Is that correct? I'm not clear on what to do with the REG command as you stated.Thanks! that will set it for THAT CMD INSTANCE ALONE. If that's what you want, then fine.If you want it for others, you could simply add that line to all your CMD files, or add it to the ENVIRONMENT registry entries. The copy paste to each CMD file is by far simpler.
April 9, 200521 yr Author that will set it for THAT CMD INSTANCE ALONE. If that's what you want, then fine.If you want it for others, you could simply add that line to all your CMD files, or add it to the ENVIRONMENT registry entries. The copy paste to each CMD file is by far simpler.<{POST_SNAPBACK}>How would I go about adding the ENVIRONMENT registry entries via batch file without over-writing the current lines as digitalfront points out?
April 9, 200521 yr You should try pathman.exe from MS Resource KitThis tool exist in different version.Here is the Win2k ...Pathman.exe
April 9, 200521 yr If you want to add a path to your unnatended XP install CD, this is what I do :Be aware that this will edit the registry files for your installation - test it in Virtual pc or similar first!You have to edit the file 'HIVESYS.INF' which is located in your \i386 folder. Search for the following keys in this (ascii text) file :HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment"There is a variable here called "Path" that contains the default system path, simply add your own to the end, remembering to precede it with a semicolon ( ; ) as below :"Path",0x00020002,"...<data cut for brevity>;%SystemRoot%\System32\Wbem;c:\gnupg"Dont change any of the values already there, just add yours to the end.I do this always to add the path to my collected command-line tools, to avoid cluttering up the system32 folder.EDIT:To make it better compatible, I suppose you could replace the 'C:' in your path with '%systemdrive%' instead, making it like ';%systemdrive%\gnupg'. This will be replaced by the letter of the drive containing windows.Hope that helps,SP
April 9, 200521 yr Author Actually, I just need a way to do this via commandline/batch file if that's able to do it
April 9, 200521 yr Actually, I just need a way to do this via commandline/batch file if that's able to do it<{POST_SNAPBACK}>Then, like gogol says, 'pathman' is the tool for you. Current link is HereThis works on XP even though it is in the 2K resource kit. Check the documentation or use 'pathman /?' to get usage info. Note that this program is installed by default into the 'C:\Program Files\Resource Kit' directory, move it somewhere in the path to get easier usage from batch files.My previous reply was based on your first post :and have it present on my unattended, out-of-the-box installSP
April 10, 200521 yr Author Using pathman.exe was the perfect solution to my problem under WinXP... now, how can I do this under Win98?
Create an account or sign in to comment