Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

adding an entry to my path statement

Featured Replies

Is there a way to automate the addition of an entry to my path statement found under:

Right-click "My Computer">Properties>Advanced>Environment Variables

Under 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!

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?

  • Author

Thanks for the info... maybe someone knows the answer to your question..?

SET PATH=%PATH%;NewEntry

Is 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.

  • Author

So I should be able to do this in my batch_file.cmd:

SET PATH=%PATH%;c:\gnupg

And 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!

So I should be able to do this in my batch_file.cmd:
SET PATH=%PATH%;c:\gnupg

And 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.

  • 3 months later...
  • 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.

How would I go about adding the ENVIRONMENT registry entries via batch file without over-writing the current lines as digitalfront points out?

You should try pathman.exe from MS Resource Kit

This tool exist in different version.

Here is the Win2k ...

Pathman.exe

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

  • Author

Actually, I just need a way to do this via commandline/batch file if that's able to do it

Actually, I just need a way to do this via commandline/batch file if that's able to do it

Then, like gogol says, 'pathman' is the tool for you. Current link is Here

This 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 install

SP

  • 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

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.