Windows 常用命令(开启热点、MD5、端口、进程等)
开启热点,需要先打开Wifi,ssid 为 WiFi 名称,key 为密码
netsh wlan set hostednetwork mode=allow ssid=123 key=12345678 netsh wlan start hostednetwork netsh wlan stop hostednetwork
查看文件 MD5 值
rem 查看文件 md5 值 certutil -hashfile filename MD5 rem 查看文件 sha1 值 certutil -hashfile filename SHA1 rem 查看文件 sha256 值 certutil -hashfile filename SHA256
重新获取 IP 地址
rem 先释放IP地址 ipconfig /release :: 再获取IP地址 ipconfig /renew
刷新 DNS 缓存
ipconfig /flushdns
查看路由表
echo 查看路由表 > nul route print
查看 arp 表
arp -a
查看下一跳
goto zs 查看下一跳 :zs tracert www.baidu.com
根据名称查找进程 PID
tasklist | findstr qq.exe
根据 PID 查看对应进程
tasklist | findstr "2016"
根据 PID 查看进程端口号
netstat -ano | findstr 4396
也可以根据端口号查看进程 PID
netstat -aon | findstr "80" wmic process | findstr "8080"
结束进程
taskkill /f /t /im qq.exe
端口转发
# 新增,listenaddress:本机IP、listenport:本机端口、connectaddress:转发IP(其他电脑)、connectport:转发端口(其他电脑) netsh interface portproxy add v4tov4 listenaddress=172.17.0.1 listenport=3306 connectaddress=172.17.0.2 connectport=3306 # 查看 netsh interface portproxy show all # 删除 netsh interface portproxy delete v4tov4 listenaddress=172.17.0.1 listenport=3306
设置环境变量
# 查看所有环境变量 set # 查看指定环境变量 set path # 临时设置用户环境变量,只在当前窗口有效 set path=D:\Java\ # 永久设置用户环境变量,setx 设置变量需要引号引起来 setx path "D:\Java\" # 追加环境变量 set path=%path%;D:\Java\ setx path "%path%;D:\Java\" # set 和 setx 默认设置的是用户变量,设置系统变量需要添加 /m setx JAVA_HOME "D:\Java\" /m
删除 PowerShell 历史记录
# CMD del %APPDATA%\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt # PowerShell Clear-History del $env:appdata\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt
Remove-AppPackage 报 HRESULT: 0x80073CFA
主要因为 NonRemovable 为 True,要修改 %ProgramData%\Microsoft\Windows\AppRepository\StateRepository-Machine.srd 这个 SQLite 库,需要 SYSTEM 用户权限
安装 python,复制 fix.py,将其中 Microsoft.MicrosoftEdge_44.19041.1266.0_neutral__8wekyb3d8bbwe 替换为要卸载的应用
import os, sqlite3 conn = sqlite3.connect(os.path.expandvars(r'%ProgramData%\Microsoft\Windows\AppRepository\StateRepository-Machine.srd')) cursor = conn.execute( ''' SELECT _PackageID, PackageFullName FROM main.Package WHERE PackageFullName LIKE "Microsoft.MicrosoftEdge_44.19041.1266.0_neutral__8wekyb3d8bbwe%"; ''' ) records_to_update = {} for row in cursor: records_to_update[row[0]] = row[1] cursor = conn.execute( ''' SELECT name, sql FROM main.sqlite_master WHERE type = "trigger" AND tbl_name = "Package" AND name LIKE "TRG_AFTER_UPDATE%"; ''' ) triggers_backup = {} for row in cursor: triggers_backup[row[0]] = row[1] # Delete update triggers for table "Package" for TriggerName, TriggerSQL in triggers_backup.items(): conn.execute( ''' DROP TRIGGER %s; ''' % TriggerName ) conn.commit() print('Trigger "%s" has been cleared.' % TriggerName) # Set IsInbox to 0 for PackageID, PackageFullName in records_to_update.items(): conn.execute( ''' UPDATE main.Package SET IsInbox = 0 WHERE _PackageID = %d; ''' % PackageID ) conn.commit() print('IsInbox of "%s" has been set to 0.' % PackageFullName) # Restore triggers for TriggerName, TriggerSQL in triggers_backup.items(): conn.execute( ''' %s; ''' % TriggerSQL ) conn.commit() print('Trigger "%s" has been restored.' % TriggerName)
下载 AdvancedRun,用它以 SYSTEM 用户启动 cmd
然后运行 python fix.py
然后就可以正常卸载了
https://www.winhelponline.com/blog/error-0x80073cfa-uninstall-app-removal-failed
https://www.winhelponline.com/blog/run-program-as-system-localsystem-account-windows
https://woshub.com/remove-appxpackage-0x80073cfa-removal-failed
https://github.com/10se1ucgo/DisableWinTracking/issues/48#issuecomment-135071405
卸载 EDGE(W10 19045.3757 或 W11 22621/31.2787 以上):https://www.neowin.net/guides/here-is-a-simple-method-to-uninstall-edge-in-windows-10-and-11
下载 vivetool 执行 vivetool /enable /id:44353396
下载 NanaRun 执行 MinSudo.exe --TrustedInstaller notepad++.exe,打开 C:\Windows\System32\IntegratedServicesRegionPolicySet.json,修改如下
"$schema": "schemas/IntegratedServicesRegionPolicySet.Schema.1.1.0.json", "version": "1.0", "policies": [ { "$comment": "Edge is uninstallable.", "guid": "{1bca278a-5d11-4acf-ad2f-f9ab6d7f93a6}", "defaultState": "enabled", # 改为 enabled "conditions": { "region": { # 打开 regedit 查看 Computer\HKEY_USERS\.DEFAULT\Control Panel\International\Geo\Name 的值,这里是 CN,添加到 enabled 中 "enabled": ["CN", "AT", "BE", "BG", "CH", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GF", "GP", "GR", "HR", "HU", "IE", "IS", "IT", "LI", "LT", "LU", "LV", "MT", "MQ", "NL", "NO", "PL", "PT", "RE", "RO", "SE", "SI", "SK", "YT"] } } }
保存重启,然后就可以看到 Edge 右键有卸载选项了