Skip to content

Latest commit

 

History

History
87 lines (62 loc) · 3.48 KB

File metadata and controls

87 lines (62 loc) · 3.48 KB

Windows

Users and Groups

SIDs is a user ID.] S-1-5-32-544 is a "well-known SID" referencing the built-in Administrators group. More "well-known SID" following this link. S-1-12-1-1347659835-1128888854-2982737882-1111120199 is an example of a user ID. More information following this link.

You might encounter some issue using git if you copied a repo accross several computers. Here's why: https://medium.com/@thecodinganalyst/git-detect-dubious-ownership-in-repository-e7f33037a8f

To change the ownership of a folder you can use takedown command in PowerShell where /r stands for "recursively" (doc): (You will need to have your admin account elevated to use this).

    takeown /f "c:\folder\subfolder" /r

Some system variables

Note that if a variable is not set echo will output the variable name...
On PowerShell instead of refering to your variable as %USERNAME% you have to use this syntaxe $env:USERNAME...
Note that variables can be used as echo %time% as well as echo %TIME%, but we will prefer to use capital case for convention.

var Description
%USERNAME% The name of the current user.
%USERPROFILE% The home dir of the current user.
%HOMEDRIVE% Is the drive that your user home is on.
%HOMEPATH% Is the path to your user home (minus the drive letter).
%PATH% The various dirs to lookup to find bins.
%TIME% The current Windows time.

CMD Misc

Note that # does not mean to make a comment on cmd.exe (but does on PowerShell), I just kept it for the sake of the documentation.

To change volume you can do:

    cd E:\Projects\Ruby # Will not change your volume, it will change the current dir of the volume `E:` but not set you up to it.
    e: # To change the current volume to `E:`.

Some commands

  • To display the sub tree structure of the current folder: tree /f .
  • To open the directory explorer from your current terminal location: explorer .
  • To know where is installed a specific executable command (similarily to which): where python

Terminal Roots

Various terminal roots (location of / on the machine):

  • MSYS: C:\Ruby33-x64\msys64; HOME C:\Ruby33-x64\msys64\home\Hellfar;
    Some documentation.
  • MinGw64:
    • Git Bash: Root: C:\Program Files\Git; Home: %HOMEDRIVE%%HOMEPATH%;
    • Ruby install: C:\Ruby33-x64\msys64 (Dir is called msys64, but the shell runs Mingw64, makes things unclear...);

MSYS

Pacman

    # To update packages.managed by pacman.
    pacman -Syu # You will have to reopen your terminal after it closed.
    # To install packages (e.g.: GTK3).
    pacman -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-gcc
    # To check on installed packages that match a string (e.g.: GTK).
    pacman -Qs gtk
    # To remove a package.
    pacman -R package_name

Python

After installing modern versions of Python, it doesn't necessarily come up with a binary for pip.
You may have to use python -m pip install ... for instance. Or do python -m pip install --force pip and add to your PATH the path its tell you to.

BATCH

Complexe arguments handling: https://stackoverflow.com/a/45070967/5384061

TODOs

  • User Account Control (UAC) managment.