Skip to content

microsoft windows Notes

Chris Jones edited this page Dec 13, 2019 · 39 revisions

Contents

General Windows 10 Notes πŸ”

🚨 Pressing control + shift at the same time causes the keyboard to enter alternate chars, ie. Γ‰ instead of /

To open a dialog displaying the current version of Windows

winver

The above command should work in cmd.exe, PowerShell, and Cmder.exe

To check and see if there are Windows 10 updates available via a CLI

explorer ms-settings:windowsupdate

The above command will launch a explorer window where windows updates can be downloaded and installed.

❗️ As of Windows 10 1809 I have not been able to figure out how to download and install updates via a CLI.

To see how long it took for a Windows 10 system to boot, open Event Viewer

πŸ“Έ Event Viewer

windows-10-boot-time

To access the emoji context menu

Winβ„’+.

ℒ️ is a reference to the Windows key.

To get a diagnostic report, a la System Inoformation on macOS on Windowsℒ️

  1. Open a run dialog box ℒ️+r
  2. Input msinfo32 into the box, press enter and a diagnostic report of the system should display within a window.

Windows 7 > General Notes

To enable password less login on Windows 7 see

Working with environment variables on Windows 10

To set an environment variable for a running terminal session and then have it clear when the session finishes in Windows 10

set code=C:\opt\code

To set the value of an environment variable permanently

setx code "C:\opt\code"

To print the value of an environment variable

echo %HOME%

Running Windows 10 in VirtualBox

From my experience running Windows 10 in VirtualBox on a MacBook with a Retina display, ie. HiDPI, it's useful to set the resolution to 1600x1200 and scale the display to 150% so that my eyes don't pop out of my head. πŸ§Ÿβ€β™‚οΈ. Those settings are applied in Windows 10 itself and are unrelated to VirtualBox settings on macOS.

Working with Linux subsystem on Windows 10 WSL

To use Linux subsystem on Windows 10, Developer Mode needs to enabled, and Windows should be a Professional version, and NOT a Home version.

To enable Developer Mode

Search for Use developer features after clicking the Winℒ️ key. Within the Settings window look for a radio button / toggle to enable Developer mode.

After Developer mode has been enabled then Windows Subsystem for Linux can be installed via the Control Panel > Add / Remove Apps > Windows Apps.

To manually install a version of Linux on Windows 10 see the following microsoft doc

To print a list of filesystems that can be mounted on a GNU+Linux or even a WSL

cat /proc/filesystems

To mount an already mapped network share that has been mapped to a local drive letter, ie. Z

sudo mkdir /mnt/z
sudo mount -t drvfs 'Z:' /mnt/z

Working with Chocolately

To install chocolately on Windows 10 see the chocolately website.

chocolately can be installed via cmd.exe or powershell.exe just make sure the cmd.exe is run with elevated priviliges.

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

The above command is for cmd.exe

To paste the above command into either powershell or cmd.exe

alt + ␣ + e + p

A decent window size for command prompt, ie. cmd.exe is

Width 90 Height 30

A decent window size for power shell is

Width 100 Height 30

Working with PowerShell on Windows 10

To avoid the ** mr-fancy-script.ps1 is not digitally signed.**

Set-ExecutionPolicy -Scope CurrentUser Bypass

Working with git on Windows 10

Cannot figure out how to use git to clone git repositories using the git protocol, however https appears to be working. πŸ‘

To show the settings in a user derived git configuration file

git config --list

Working with Cmder

To set an alias for git status

alias gs=git status $*

To set an alias for git push

alias gp=git push $*

To refresh "shell" / environment using cmder

refreshenv

The above command is useful when changes to such things as PATH have been made, and the terminal does not need to closed and reopened.

Working with Firefox

To access a locally running app, ie. a Node.js / Express app on a local port on Windows 10

  1. about:config
  2. search for ports
  3. add the below setting
network.security.ports.banned.override
  1. Add a list of ports, ie. 4242,3000

For more information see

Working with networking in Windows 10

To be able to ping a Windows host on a LAN

Open the firewall settings, and make sure firewall settings are disabled for private networks.

Connecting to a SMB share

To access a SMB share on a local network in Windows 10

  1. Open the run dialog box, ie. β„’+.
  2. Insert the IP address of the SMB server you would like to connect to
\\[192.168.1.42]

The IP address of the SMB server can be specified or the local discoverable name can be used, which is preferred. ie. mr-fancy-42-computer.local

Ex

\\mr-fancy-computer.local

Inputting \\ is imperative to being able to connect to the share. πŸ‘

  1. A dialog box should appear, prompting for credentials.

Useful Links πŸ”

Clone this wiki locally