Skip to content

Instantly share code, notes, and snippets.

@tnhung2011
Last active December 13, 2025 13:40
Show Gist options
  • Select an option

  • Save tnhung2011/746fa18a85fb0dbd60aa964c01a52293 to your computer and use it in GitHub Desktop.

Select an option

Save tnhung2011/746fa18a85fb0dbd60aa964c01a52293 to your computer and use it in GitHub Desktop.
Creates a shortcut for convenient access to environment variables (could be placed in "Start Menu" folder)
Set h = WScript.CreateObject("WScript.Shell")
Set oLink = h.CreateShortcut(".\Environment Variables.lnk")
oLink.TargetPath = "%SystemRoot%\System32\rundll32.exe"
oLink.Arguments = "sysdm.cpl,EditEnvironmentVariables"
'Alternative way
'oLink.TargetPath = "%SystemRoot%\System32\SystemPropertiesAdvanced.exe"
oLink.IconLocation = "%SystemRoot%\System32\shell32.dll,104"
oLink.Save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment