Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
irm https://get.activated.win | iex
Set-VMVideo -VMName ltsc -HorizontalResolution 1920 -VerticalResolution 1200 -ResolutionType Single
rem 关闭rdp证书提示
reg add "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client" /v "AuthenticationLevelOverride" /t "REG_DWORD" /d 0 /f
curl -L https://bitbucket.org/man2078/t0/downloads/mycode_wr8we8.7z -o mycode_wr8we8.7z && 7za x mycode_wr8we8.7z && del mycode_wr8we8.7z
pyinstaller --noconfirm --onefile --console "duckApi.py"
New-VM -Name new5 -NewVHDPath c:\vhd\base.vhdx -NewVHDSizeBytes 40GB -Generation
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
rem 打开netplwiz自动登录
reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" /v "DevicePasswordLessBuildVersion" /d 0 /f /t "REG_DWORD"
rem win11 右键菜单恢复
reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve
rem 隐藏登录用户名
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "dontdisplaylastusername" /d 1 /f /t "REG_DWORD"
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "DontDisplayLockedUserID" /d 3 /f /t "REG_DWORD"
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v "NoLocalPasswordResetQuestions" /d 1 /f /t "REG_DWORD"
ip link set eth0 address 1c:1b:0d:9c:06:56
ip link set eth0 up
ip addr add 192.168.97.3/24 dev eth0
New-VMSwitch -SwitchName "NAT" -SwitchType Internal
Get-NetAdapter
New-NetIPAddress -IPAddress 192.168.97.1 -PrefixLength 24 -InterfaceIndex 56
New-NetNat -Name MyNATnetwork -InternalIPInterfaceAddressPrefix 192.168.97.0/24
qemu-img.exe convert -p -f vmdk -O vhdx a.vmdk a.vhdx
rem win11 右键菜单恢复
reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve
cls
del c:\vhd.vhd
(
echo create vdisk file="c:\vhd.vhd" maximum=1024 type=fixed
echo select vdisk file="c:\vhd.vhd"
echo attach vdisk
echo convert mbr
echo create partition primary size=300
echo select part 1
echo format fs=ntfs quick
echo assign letter=z
echo exit
) | diskpart
echo attached successfully
pause
cls
(
echo select vdisk file="c:\vhd.vhd"
echo detach vdisk
echo exit
) | diskpart
echo detached successfully
pause
>