Skip to content

Instantly share code, notes, and snippets.

@MarkTiedemann
Created May 19, 2021 21:32
Show Gist options
  • Select an option

  • Save MarkTiedemann/a58ec6d74460fdc2e1200a75bc08d028 to your computer and use it in GitHub Desktop.

Select an option

Save MarkTiedemann/a58ec6d74460fdc2e1200a75bc08d028 to your computer and use it in GitHub Desktop.
<!-- read_path_from_registry.hta -->

<style>

textarea {
	width: 100%;
	height: 50%;
}

</style>

<textarea id="machine_path"></textarea>
<textarea id="user_path"></textarea>

<script>

var sh = new ActiveXObject("WScript.Shell");
machine_path.value = sh.regRead("HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\Path").split(";").join("\n");
user_path.value = sh.regRead("HKEY_CURRENT_USER\\Environment\\Path").split(";").join("\n");

</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment