Windows
下载地址
镜像
快捷键
虚拟桌面
操作 | 快捷键 | 备注 |
---|---|---|
打开任务视图 | Win + Tab | |
添加虚拟桌面 | Win + Ctrl + D | |
在右侧创建的虚拟桌面之间切换 | Win + Ctrl + 右箭头 | |
在左侧创建的虚拟桌面之间切换 | Win + Ctrl + 左箭头 | |
关闭您正在使用的虚拟桌面 | Win + Ctrl + F4 |
安装系统时使用本地账号
在联网界面,同时按住 Shift+F10,打开任务管理。
找到 Network Connection Flow/网络链接流,结束该进程。
清除共享用户信息
命令行
bash
# 清除所有
net use * /d //@
# 清除指定链接
net use \\192.168.0.250 /del //@
手工
bash
# 方法一
控制面板->用户账户->凭据管理器->管理Windows凭据
# 方法二
CMD->control userpasswords2->用户管理->高级->管理密码
家庭版安装Hyper-V
https://learn.microsoft.com/zh-cn/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v
保存以下内容到hyperv.cmd,然后右键以管理员身份运行即可
bash
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL
命令行断开防火墙端口
bash
netsh advfirewall firewall add rule name=HTTP dir=in action=allow protocol=TCP localport=80
netsh advfirewall firewall add rule name=HTTPS dir=in action=allow protocol=TCP localport=443
netsh advfirewall firewall add rule name=WSL dir=in action=allow protocol=TCP localport=22
netsh advfirewall firewall add rule name=MySQL dir=in action=allow protocol=TCP localport=3306
netsh advfirewall firewall add rule name=RabbitMQ dir=in action=allow protocol=TCP localport=5672
netsh advfirewall firewall add rule name=RabbitMQ dir=in action=allow protocol=TCP localport=15672
netsh advfirewall firewall add rule name=Redis dir=in action=allow protocol=TCP localport=6379
远程桌面服务
https://learn.microsoft.com/zh-cn/windows-server/remote/remote-desktop-services/welcome-to-rds
环境变量
bash
# 查看环境变量
Write-Output $Env:PATH
# 添加系统级环境变量
$target="Machine";
$path = [Environment]::GetEnvironmentVariable(‘Path’, $target);
$newPath = $path + ";D:\Tools\DEV";
[Environment]::SetEnvironmentVariable("Path", $newPath, $target)
# 添加用户级环境变量
$target="User";
$path = [Environment]::GetEnvironmentVariable(‘Path’, $target);
$path = $path + ";D:\Tools\DEV";
[Environment]::SetEnvironmentVariable("Path", $newPath, $target)
完整示例
bash
setx SHELL_HOME "D:\Tools\Shell"
setx JAVA_HOME_21 "D:\Tools\Java\jdk-21"
setx JAVA_HOME_17 "D:\Tools\Java\jdk-17"
setx JAVA_HOME_11 "D:\Tools\Java\jdk-11"
setx JAVA_HOME_8 "D:\Tools\Java\jdk-8"
setx JAVA_HOME "D:\Tools\Java\jdk-21"
setx GRAALVM_HOME "D:\Tools\Java\graalvm"
setx GRADLE_HOME "D:\Tools\Java\gradle"
setx M2_HOME "D:\Tools\Java\maven"
setx GIT_HOME "D:\Tools\MinGit"
setx KOTLIN_HOME "D:\Tools\Kotlin"
setx PHP_HOME "D:\Tools\PHP\PHP"
setx COMPOSER_HOME "D:\Tools\PHP\Composer"
setx NODE_HOME "D:\Tools\Node\node"
setx NVM_HOME "D:\Tools\Node\nvm"
setx NVM_SYMLINK "D:\Tools\Node\node"
setx MYSQL_HOME "D:\Tools\MySQL\Server"
setx ES_HOME "D:\Tools\Elastic\elasticsearch"
setx SCALA_HOME "D:\Tools\Scala"
setx KAFKA_HOME "D:\Tools\Kafka\Server"
setx PGSQL_HOME "D:\Tools\PostgreSQL\Server"
setx NET_SDK_HOME "D:\Tools\Net\SDK"
setx PY_HOME "D:\Tools\Python"
setx CARGO_HOME "D:\Tools\Rust\cargo"
setx RUSTUP_HOME "D:\Tools\Rust\rustup"
$path = "";
$path = $path + "%SHELL_HOME%;"
$path = $path + "%JAVA_HOME%\bin;"
$path = $path + "%GRADLE_HOME%\bin;"
$path = $path + "%M2_HOME%\bin;"
$path = $path + "%GIT_HOME%\cmd;"
$path = $path + "%KOTLIN_HOME%\bin;"
$path = $path + "%NVM_HOME%;"
$path = $path + "%NODE_HOME%;"
$path = $path + "%MYSQL_HOME%\bin;"
$path = $path + "%ES_HOME%\bin;"
$path = $path + "%PHP_HOME%;"
$path = $path + "%COMPOSER_HOME%;"
$path = $path + "%COMPOSER_HOME%;"
$path = $path + "%SCALA_HOME%\bin;"
$path = $path + "%KAFKA_HOME%\bin\windows;"
$path = $path + "%PGSQL_HOME%\bin;"
$path = $path + "%NET_SDK_HOME%;"
$path = $path + "%PY_HOME%;"
$path = $path + "%PY_HOME%\Scripts;"
$path = $path + "%CARGO_HOME%\bin;"
$path = $path + "%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;"
setx Path $path