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.

Setting path cariable permanently

Featured Replies

Hi there,

I want to add the following directory to my Path variable: "c:\Program Files\IT+ES command line applications" permanently. I tried the following vb-script, but after restart, when I want to run a command, e.g. net user, it says, that it can't find this command. In my own directory, I can run the commands. It seems to add the directory in a right way, but I think there's missing some escape Character or something like this, cause, when I add the directory manually, everything works fine.

Anyone got an idea or another way to do this?

Set wshshell = CreateObject("WScript.Shell")

key_path_cur = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path"
key_path_001 = "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment\Path"
key_path_002 = "HKLM\SYSTEM\ControlSet002\Control\Session Manager\Environment\Path"

app_dir = "%PROGRAMFILES%\IT+ES command line applications"
app_dir = wshshell.ExpandEnvironmentStrings(app_dir)

cur_path = wshshell.RegRead(key_path_cur)

new_path = cur_path&";"& app_dir

wshshell.RegWrite key_path_001, new_path
wshshell.RegWrite key_path_002, new_path


care to elaborate the purpose?

like, do you want to be able to do something like such

set lastgood=%systemroot%\lastgood

so that you could then do

%lastgood% and goto the above directory

if this is the purpose, remember, when using dynamic values, like %systemroot, you can just use, a string, but rather an expanable string value.

also changing reg keys, then exporting, and edit the .reg file to only have what you need, can make things easier, but remember to make a backup first, to restore to, b4 you restart the computer, if you think it might b0rk things.

  • Author

Just found my mistake. The trouble came from, that the newly created regvalues have type REG_SZ. So I added the type and everything works fine

wshshell.RegWrite key_path_001, new_path,"REG_EXPAND_SZ"
wshshell.RegWrite key_path_002, new_path,"REG_EXPAND_SZ"

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.