# windows

* [CMD](#cmd)
* [Versions](#versions)
* [Windows 11](#windows-11)
* [Components](#components)
* [Driver Backup](#driver-backup)
* [powercfg](#powercfg)
* [Disable BitLocker](#disable-bitlocker)
* [Networking](#networking)
  * [IP](#ip)
  * [VLAN](#vlan)
* [Restore OS](#restore-os)
* [DotNet versions query](#dotnet-versions-query)
* [Configuration](#configuration)
  * [Disable Windows Defender](#disable-windows-defender)
  * [Disable update](#disable-update)
  * [Registry locations](#registry-locations)
  * [NFS mount](#nfs-mount)
  * [Fix cifs/share mount](#fix-cifsshare-mount)
* [Installation](#installation)
  * [Tools](#tools)
  * [Force OOBE](#force-oobe)
* [BCD](#bcd)
  * [Fix boot](#fix-boot)
    * [update-grub](#update-grub)
  * [Fix boot partiton](#fix-boot-partiton)
    * [EFI](#efi)
  * [disk ATTRIBUTES](#disk-attributes)
  * [IDE to AHCI after Installation](#ide-to-ahci-after-installation)
  * [Uninstall software in safemode](#uninstall-software-in-safemode)
* [services.msc](#servicesmsc)
* [VS proxy](#vs-proxy)
* [AD](#ad)
  * [DC DNS](#dc-dns)
* [Graphic](#graphic)
* [Storge](#storge)
* [Link](#link)
* [CMD Tools](#cmd-tools)
  * [Check and unclock file](#check-and-unclock-file)
  * [Media Transfer Protocol](#media-transfer-protocol)
* [Server Core](#server-core)
  * [MMC](#mmc)
* [GUI Tools](#gui-tools)
  * [sysinternals tools](#sysinternals-tools)
* [Linux Clients](#linux-clients)
* [WLAN Hosted Network](#wlan-hosted-network)
* [简繁体转换](#简繁体转换)
* [mstsc](#mstsc)
  * [GPU - NVIDIA](#gpu---nvidia)
  * [CredSSP](#credssp)
* [Disk tools](#disk-tools)
* [KMS Activation](#kms-activation)
  * [Windows](#windows)
  * [Office](#office)

## CMD

```
cd C:\Users\root\AppData\Roaming\Microsoft\Windows\Start Menu\Programs   
shell:startup # Startup Folder

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP # Query .Net Framwork Versions  

timedate.cpl # Date + Time + NTP
netplwiz.exe # Auto Login
```

## Versions

<https://learn.microsoft.com/en-us/windows/release-health/release-information>

* Win10: 19041=2004 19045=22H2(EOS on October 14, 2025)
* Win11: 22000=21H2 22621=22H2 26200=25H2
* Server: 14393=2016 17763=2019 20348=2022

## Windows 11

Download: <https://www.microsoft.com/en-in/software-download/windows11>

```
# bypass TPM
`SHIFT + F10` -> regedit -> HKEY_LOCAL_MACHINE\SYSTEM\Setup
 - new Key: LabConfig
 - new DWORD : BypassTPMCheck / BypassSecureBootCheck / BypassRAMCheck(if<4G) = 1

# Disable "Show more options" context menu
reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve
```

## Components

```
DirextX Runtime: dxwebsetup
.Net 4: dotNetFx40_Full_x86_x64.exe
```

## Driver Backup

```
dism /online /export-driver /destination:d:\_drivers
```

## powercfg

```
powercfg /a
powercfg /hibernate off
```

## Disable BitLocker

```
manage-bde -status
manage-bde -off C:

# Powershell - Disable BitLocker
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\BitLocker" -Name "PreventDeviceEncryption" -Value 00000001 -PropertyType DWORD -Force 
```

## Networking

```cmd
netsh interface ipv4 show excludedportrange protocol=tcp

netstat -ano | findstr LISTEN
netsh interface portproxy add v4tov4 listenport=3333 listenaddress=0.0.0.0 connectport=3213 connectaddress=127.0.0.1 
route add 192.168.0.0  MASK 255.255.0.0 10.0.0.1
route add 172.16.0.0  MASK 255.255.0.0 10.0.0.1
netsh interface ip set address "Ether..." static 192.168.3.5 255.255.255.0 192.168.3.2

SUBST X: "D:\Folder_to_map"
```

### IP

```
Set/New-NetIPAddress -InterfaceIndex 6 -IPAddress 192.168.1.11 -PrefixLength 24
Remove-NetIPAddress -PrefixOrigin Manual
```

### VLAN

<https://learn.microsoft.com/en-us/powershell/module/netadapter/set-netadapter?view=windowsserver2022-ps#examples>

* enable vlan on `devmgmt.msc`, then:

  ```
    Get-NetAdapter
    Set-NetAdapter -InterfaceDescription "*GbE"  -VlanID 77 # TODO
  ```

## Restore OS

<https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/boot-windows-to-audit-mode-or-oobe>

```
sysprep /generalize
CTRL+SHIFT+F3 to audio mode
```

## DotNet versions query

```
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" /v Version
```

## Configuration

gpupdate

### Disable Windows Defender

* gpedit.msc: Computer Configuration/Administrative Templates/Windows Components/Windows Defender

### Disable update

1. 计算机配置 -> 管理模板 -> Windows 组件 -> Windows 更新 -> Windows 更新不包括驱动程序
2. 计算机配置 -> 管理模板 -> 系统 -> 设备安装 -> 指定设备驱动程序源位置的搜索顺序：启用并选择“不搜索 Windows 更新”

### Registry locations

* %WINDIR%\System32\config\\
* <https://technet.microsoft.com/en-in/library/cc750583(en-us).aspx>

### NFS mount

Turn Windows features on or off -> Services for NFS

```
# seems not working anymore (Dec 2019)
Get-WindowsFeature -Name NFS*
Install-WindowsFeature -Name NFS-Client

mount 192.168.88.21:/  x:
mount # show mounted
umount -f z:
```

<https://unix.stackexchange.com/questions/276292>

```
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default]
"AnonymousUid"=dword:000003e8
"AnonymousGid"=dword:000003e8
```

### Fix cifs/share mount

```
net use * /del /yes
net use h: \\192.168.0.1\docs /user:ServerB\user Password 
```

## Installation

### Tools

* [winntsetup](http://www.msfn.org/board/topic/149612-winntsetup-v386/)

### Force OOBE

* Shift+F10
* c:\windows\system32\oobe\msoobe.exe

## BCD

GUI editor: <http://www.zezula.net/en/fstools/bellavista.html>

### Fix boot

<https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/adding-boot-entries#adding-a-new-boot-en>

#### update-grub

```
Found Windows Boot Manager on /dev/sdf1@/EFI/Microsoft/Boot/bootmgfw.efi
```

### Fix boot partiton

<https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/bcdboot-command-line-options-techref-di#command-line-options>

```
bcdboot X:\Windows /s [system partition] /f [UEFI/BIOS/ALL] /v
- UEFI/GPT : \EFI\Microsoft\Boot
- BIOS/MBR : \Boot
```

#### EFI

\EFI\Boot\bootx64.efi

```
diskpart
convert
create partition efi size=512
select partition 2
assign letter=b

diskpart>
list disk # check column `Gpt`  = "*"
list vol  # check column `Info` = "System"

bcdboot x:\windows /s b: /f UEFI

bcdedit /set {current} description "Windows 11 21H2"
```

### disk ATTRIBUTES

```
DISKPART> list disk
DISKPART> ATTRIBUTES DISK
DISKPART> ATTRIBUTES DISK CLEAR READONLY
```

### IDE to AHCI after Installation

* HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Services\\

  Win7 -> msahci： Win10 -> iaStorV,iaStorAV,storahci: Start => 0\
  \StartOverride => DELETE

### Uninstall software in safemode

REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\MSIServer" /VE /T REG\_SZ /F /D "Service" net start msiserver

## services.msc

```
sc create srv_name binpath= D:\_soft\foo.exe type= share start= auto 
```

sc delete srv\_name

## VS proxy

%ProgramFiles%\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe.config find the \<system.net> block, and add this code:

```
<defaultProxy enabled="true" useDefaultCredentials="true">  
    <proxy bypassonlocal="True" proxyaddress=" HYPERLINK "http://<yourproxy:port#" http://<yourproxy:port#>"/>  
</defaultProxy> 
```

## AD

### DC DNS

<https://blogs.msdn.microsoft.com/servergeeks/2014/07/12/dns-records-that-are-required-for-proper-functionality-of-active-directory/> (4. DC Record - \_ldap.\_tcp.dc.\_msdcs.)

## Graphic

<https://docs.microsoft.com/en-us/windows-hardware/drivers/display/\\>
<https://en.wikipedia.org/wiki/Windows\\_Display\\_Driver\\_Model>

XDDM/XPDM:Windows 2000 and Windows XP, removal of XDDM from Windows 8\
Windows Display Driver Model (WDDM): Windows Vista+

```
WDDM 2.0 - Windows 10+
    reduce workload on the kernel-mode driver for GPUs that support virtual memory addressing
    DXGI 1.4
        Cheaper adapter enumeration
        Video memory budget tracking
        Direct3D 12 Swapchain Changes

WDDM 2.1 - 1607+
    Shader Model 6.0 (mandatory for feature levels 12_0 and 12_1)
    DXGI 1.5
        HDR10 - a 10-bit high dynamic range
        Wide Color Gamut

WDDM 2.2 - 1703+
    tailored for virtual, augmented and mixed reality with stereoscopic rendering for the Windows Holographic platform
    DXGI 1.6: High Dynamic Range (HDR) Detection

WDDM 2.3 - 1709+
    10-bit HDR playback over HDMI
    Video processing and video decode acceleration in DirectX* 12
```

## Storge

dynamic disks support the creation of new multipartition volumes

## Link

symbolic vs junction: <https://superuser.com/a/1291446>

```
mklink /J hard_link folder
mklink /H hard_link file
mklink /D soft_link folder
```

## CMD Tools

### Check and unclock file

* <https://download.sysinternals.com/files/Handle.zip>
* <http://unlocker.en.softonic.com/>

### Media Transfer Protocol

* python 3.12 | <https://github.com/Heribert17/mtp>
  * <https://heribert17.github.io/mtp/win\\_access/#mtp.win\\_access.PortableDeviceContent.get\\_path>
* powershell | <https://github.com/nosalan/powershell-mtp-file-transfer> # file size = 0

## Server Core

<https://technet.microsoft.com/en-us/library/jj574205(v=ws.11).aspx>

```
cscript C:\Windows\System32\Scregedit.wsf /ar 0    # Enable RDS
```

### MMC

```
Enable-NetFirewallRule -DisplayGroup "Remote Administration"

cmdkey /add:<ServerName> /user:<UserName> /pass:<password>
```

## GUI Tools

List: <https://www.hanselman.com/tools\\>
SoftPerfect RAM Disk: <https://www.softperfect.com/products/ramdisk>

### sysinternals tools

<https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite>

```
process explorer
- search opened file
- locate handle process
```

## Linux Clients

<http://www.freerdp.com/>

## WLAN Hosted Network

```
NETSH WLAN show drivers | findstr "Hosted network supported"
NETSH WLAN set hostednetwork mode=allow ssid=SF3 key=12345678
NETSH WLAN start hostednetwork
```

## 简繁体转换

win10: 先Ctrl+F，按住Ctrl，再按Shift+F

## mstsc

### GPU - NVIDIA

<https://developer.nvidia.com/nvidia-opengl-rdp\\>
GeForce drivers R440 or later.

### CredSSP

gpedit.msc - Computer Configuration > Administrative Templates > System > Credentials Delegation Encryption Oracle Remediation policy: Enabled > Protection Level: Vulnerable

## Disk tools

DM Disk Editor and Data Recovery <https://dmde.com/> (view for viewing)

## KMS Activation

### Windows

```
CSCRIPT /NOLOGO C:\Windows\System32\SLMGR.VBS /?  # echo on console
```

<https://technet.microsoft.com/en-us/library/jj612867.aspx>

```
slmgr /ipk {GVLK}
slmgr /SKMS 192.168.88.250    
slmgr /ATO
slmgr /dli
slmgr /upk # back to trial
```

### Office

2016/2019/O365 Retail -> VL: <https://github.com/kkkgo/office-C2R-to-VOL>

<https://docs.microsoft.com/en-us/deployoffice/vlactivation/gvlks>

```
cd OFFICE_DIR
CSCRIPT OSPP.VBS /SETHST:192.168.88.101
CSCRIPT OSPP.VBS /ACT
```
