User Tools

Site Tools


windows_notes

This is an old revision of the document!


dummy

Check windows version

winver

Set environment variables

Using the run prompt (windows key + r)

rundll32 sysdm.cpl,EditEnvironmentVariables

Using the cmd prompt

C:\Windows\System32\rundll32.exe sysdm.cpl,EditEnvironmentVariables

unset environment variable

To temporarily unset an environment variable

set FOOBAR=

This will remove the variable from the current environment (not permanently).

Ref:- https://stackoverflow.com/questions/13222724/command-line-to-remove-an-environment-variable-from-the-os-level-configuration

dump environment variables

user environment variables

reg query HKEY_CURRENT_USER\Environment > user_env_vars.txt

system environment variables

reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" > system_env_vars.txt

tested on | windows 7

script - dump_env_vars.bat (github.com/KamarajuKusumanchi)

Ref - https://stackoverflow.com/questions/573817/where-are-environment-variables-stored-in-registry

refresh environment variables

tags | git bash reread environment variables

Scenario:

  • I updated an environment variable and want to use the new value in an existing git bash shell running inside conemu. Normally, this would require to close the existing bash shell and start a new one. One way to work around is to use the refreshenv.sh script from https://github.com/badrelmers/RefrEnv

list of installed packages

Control Panel → Programs and Features shows the list of installed packages.

Tested on | Windows 10 Enterprise

create a file starting with dot in explorer

To create a file with a dot at the beginning in explorer, add another dot at the end. Like .condarc. . Explorer will allow it and remove the trailing dot.

Ref: https://superuser.com/questions/64471/create-rename-a-file-folder-that-begins-with-a-dot-in-windows

last reboot time

tags | when was a windows machine rebooted, check when a windows machine was rebooted.

In git bash

systeminfo | grep -i "boot time"

In the Windows run box

cmd /k systeminfo | find /i "boot time"

In windows shell

systeminfo | find /i "boot time"

or

systeminfo | find "System Boot Time"

Works in Windows 7, Windows 2012.

Ref:-

Linux to Windows

tags | equivalent of foo in windows

software I am currently evaluating

wifi password

Control Panel\Network and Internet\Network and Sharing Center
-> View your active networks -> click the link after "Connections:"
-> which will be something like Wi-Fi (SSID)
-> Wireless Properties -> Security -> Network security key
-> Show characters -> enter the admin password

clear recent files list

batch script

batch file calling another batch file

windows_notes.1683823593.txt.gz · Last modified: 2023/05/11 16:46 by admin