Windows

Windows #

Windows vmmem WSL process takes huge amount of memory #

  1. Shut down the WSL from command line

    wsl --shutdown

  2. Restart docker service

Change firewall settings for a network adapter #

  1. Open Start > Settings > Network & Internet > Ethernet > Your adapter.
  2. Select the desired “Network profile”

Where are Microsoft store apps saved? #

From Windows File Explorer:

shell:AppsFolder

Windows Subsystem for LINUX WSL #

Access linux home directory from windows:

From Windows File Explorer, go to \wsl$

Calculate CRC MD5 hash of a file #

certutil -hashfile file.ext MD5

Calculate CRC SHA256 of a file #

certutil -hashfile file.ext SHA256

Copy only non-empty folders/directories #

xcopy srcDir targetDir /S

Uninstall problematic Microsoft Store apps/packages (found in ProgramFiles\WindowsApps) #

From powershell with Admin permissions

Remove-AppxPackage -Package <FULL_PACKAGE_NAME>

For example:

Remove-AppxPackage -Package Microsoft.MinecraftUWP_1.19.5101.0_x64__8wekyb3d8bbwe

  • Symbolic link: A link to a file or directory on the same or different volume (drive letter) or even to a remote file or directory (using UNC in its path).
  • Hard Link: A link to a file on the same volume (drive letter) only. Every file (file’s data) has at least 1 hard link (file’s name). Deleting all hard links effectively deletes the file.
  • Junction: A link to a directory on the same or different volume (drive letter) but not to a remote directory.

from https://superuser.com/questions/67870/what-is-the-difference-between-ntfs-hard-links-and-directory-junctions

MKLINK [[/D] | [/H] | [/J]] Link Target

   /D      Creates a directory symbolic link.  Default is a file symbolic link.  
   /H      Creates a hard link instead of a symbolic link.  
   /J      Creates a Directory Junction.
   
   Link    specifies the new symbolic link name.   
   Target  specifies the path (relative or absolute) that the new link refers to.
rmdir <DIR>

A symbolic link is a file-system object that points to another file system object (eg: file/directory).

  • MKLINK can be used to create symbolic links. Using the /D parameter creates a directory symbolic link. MKLINK does not check if the target is a file or a directory or even if the target exists! This means you can potentially create invalid links like a directory symbolic link to a file or a symbolic link to a no-existing file/directory.
  • Symbolic links can either be absolute or relative links. Absolute links are links that specify each portion of the path name while relative links are determined relative to where relative-link specifiers are in a specified path.
  • Absolute symbolic links can point to files/directories on the same or different volume, as well as, to a remote file or directory using the UNC path. However, relative symbolic links are restricted to a single volume.
  • Elevated privileges are required to create a symbolic link though once created elevated privileges are not required to delete the link.

A hard link is the file system representation of a file by which more than one path references a single file.

  • MKLINK permits creating hard links (using the /H parameter) only of files (not directories). A hard link can only be created of a file in the same volume.
  • A file with multiple hard links is only actually deleted when all hard links are deleted i.e. the link count reaches zero. So really every file you create has at least one hard link for it whether you use MKLINK or not.
  • Any changes to that file are instantly visible to applications that access it through the hard links that reference it. However, the directory entry size and attribute information is updated only for the link through which the change was made.
  • Note that the attributes on the file are reflected in every hard link to that file, and changes to that file’s attributes propagate to all the hard links. For example if you un-set the read-only attribute on a hard link to delete that particular hard link, and there are multiple hard links to the actual file, then you will need to re-set the read-only attribute on the file from one of the remaining hard links to bring the file and all remaining hard links back to the read-only state.

Junctions #

A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories, and a junction can link directories located on different local volumes on the same computer. Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.

  • MKLINK permits creating a junction (using the /J parameter) of a directory (and even of files though this should probably be deemed as an invalid link).

  • A junction could be thought of as the hard link equivalent for a symbolic link to a directory. A junction link cannot be created to a remote directory but can be created to a directory on same/different volume.

Feature File hardlink Directory junction Symbolic link
Work on files Files only No Yes
Works on folders No Folders only Yes
Same volume Yes Yes Yes
Different volume No Yes Yes
UNC Path No No Yes
Standard user No Yes Admin Only

Analyze windows defender performance #

Find out why windows defender is slow

Performance analyzer for Microsoft Defender Antivirus

Windows remote desktop - clipboard stops working #

Kill the rdpclip.exe process from task manager and then start it again (Task manager > File > Run new task)