Windows User Guide

Windows 用户指引

常用路径

路径快捷方式

快捷方式 实际路径
%HOMEPATH% C:\Users\<Current Username>
%USERPROFILE% C:\Users\<Current Username>
%APPDATA% C:\Users\<Current Username>\AppData\Roaming

常用命令

用快捷键 Windows + R 调出运行框,可运行一下命令:

命令 作用
shutdown /r 重启 Windows
ms-settings: Windows 10 设置界面
快捷键 作用
Win + Ctrl + Shift + [数字键] 管理员权限运行任务栏快捷方式

系统管理和配置

快捷键失灵

Windows 快捷键失效 注册表设置:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoWinKeys = 0
Windows 开始菜单失效 PowerShell:Get-AppxPackage | % { Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppxManifest.xml" -verbose }

系统服务

# 添加系统服务
optionalfeatures.exe
# 命令行激活 Hyper-V
Enable-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -All -Online

命令行配置

REM 刷新环境变量
refreshenv

修改命令行默认编码:

# 命令行环境执行
# UTF-8
chcp 65001
# GBK
chcp 936

 可以编辑注册表,使命令行启动时自动切换为 UTF-8 编码:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]
"Autorun"="chcp 65001"

电源管理

# 关闭休眠
powercfg /h off

磁盘管理

添加 VHD 安装的系统

bcdedit /copy {current} /d "Win 10 TP"
已将该项成功复制到 {393c0654-96da-11e4-bf22-9ab4676f1d89}。

bcdedit /set {393c0654-96da-11e4-bf22-9ab4676f1d89} device vhd=[C:]\VHDs\en_windows_server_technical_preview_vhd_x64_5554157.vhd
操作成功完成。

bcdedit /set {393c0654-96da-11e4-bf22-9ab4676f1d89} osdevice vhd=[C:]\VHDs\en_windows_server_technical_preview_vhd_x64_5554157.vhd
操作成功完成。

bcdedit /set {393c0654-96da-11e4-bf22-9ab4676f1d89} detecthal on
操作成功完成。

bcdedit /v

网络及安全管理

免密码登录

control userpasswords2 # Windows 7

DNS 查询及设置

ipconfig /all | findstr /i "DNS Servers"
$wmi = Get-WmiObject win32_networkadapterconfiguration
$wmi.SetDNSServerSearchOrder("10.9.97.4")

命令行代理

[Environment]::SetEnvironmentVariable('http_proxy', 'http://localhost:7080');
[Environment]::SetEnvironmentVariable('https_proxy', 'http://localhost:7080'); 

常用工具

PEAP/LEAP 扩展无线身份验证协议驱动

快捷命令

control.exe /name Microsoft.NetworkAndSharingCenter 控制面板 > 网络和共享中心

连接 PEAP 无线网络

500 强企业大多通过思科 PEAP 协议架设企业无线,个人 Windows 设备可以安装本节上方对应的驱动,参考以下步骤接入网络。

Paging
Next
Prev

开启指定端口

运行 wf.msc 启动 windows 防火墙控制台,新建入站端口规则(以下以 22 端口为例):

Paging
Next
Prev

端口转发

netstat -na | findstr "PORT_NUM"

# Windows 本地端口转发
netsh interface portproxy add v4tov4 listenport=LOCAL_PORT listenaddress=0.0.0.0 connectport=TARGET_PORT connectaddress=TARGET_IP

# 删除端口转发规则
netsh interface portproxy delete v4tov4 listenport=LOCAL_PORT listenaddress=0.0.0.0 

# 查看既有端口转发规则
netsh interface portproxy show all

# 清除端口转发规则
netsh interface portproxy reset

远程桌面

0x204 错误

We couldn't connect to the remote PC. Make sure the PC is turned on and connected to the network, and that remote access is enabled.

Error code: 0x204

解决方法:两台机器用 IP 互 ping,如果 ping 不通则是网络问题。家庭网络考虑重启无线路由。

WIFI 自动重连

REM 列出所有已存 WIFI 热点及无线网卡
netsh wlan show profiles
netsh wlan show interface

REM 命令行连接制定热点
netsh wlan connect name="热点名" interface="无线网卡名"

备份及还原

WinPE

下载并安装 Windows ADK,使用以下命令制作 WinPE 启动盘。

copype amd64 C:\Win10PE
# MakeWinPEMedia /ISO C:\Win10PE C:\Win10PE\Win10PE.iso
# 想定 USB 盘符为 U
MakeWinPEMedia /UFD C:\Win10PE U:

Surface

 常用工具

CRU 设置低分辨率
Surface Tools Surface 工具包

Windows To Go

系统升级

设置注册表项目 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\PortableOperatingSystem = 0,重启后即可更新 Windows To Go 系统。系统更新后,恢复原值。

Author: njun
njun's picture
Updated: 2021/07/19