差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
public:it:windows [2021/10/09 09:58] oakfirepublic:it:windows [2024/04/17 10:20] (当前版本) – [BAT] oakfire
行 1: 行 1:
 ====== Windows ====== ====== Windows ======
 +  * [[https://github.com/Awesome-Windows/Awesome/blob/master/README-cn.md|github Awesome-Windows]]
   * [[public:it:windows:windows_bsod]]   * [[public:it:windows:windows_bsod]]
   * [[public:it:windows:security]]   * [[public:it:windows:security]]
   * [[https://techcommunity.microsoft.com/t5/ask-the-performance-team/sessions-desktops-and-windows-stations/ba-p/372473|sessions desktops and windows stations]]   * [[https://techcommunity.microsoft.com/t5/ask-the-performance-team/sessions-desktops-and-windows-stations/ba-p/372473|sessions desktops and windows stations]]
 +  * [[public:it:windows:localhost_ca|给 localhost 添加CA证书]]
 +  * [[https://docs.microsoft.com/en-us/sysinternals/downloads/winobj|WinObj]] 系统对象查看器,可查看串口
 +  * [[https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/validation-os-overview?view=windows-11|Validation OS]] 基于win11的轻量级命令行工具OS
 +  * [[https://zhuanlan.zhihu.com/p/37877070|桌面动态壁纸原理]]
 +
 ===== Tips ===== ===== Tips =====
 +  * ping 侦测保活同时记录:powershell 执行 <code>ping -t 192.168.1.1 | Foreach{"{0} - {1}" -f (Get-Date),$_} > D://work/ping-log.txt</code>
   * 查看 dns 缓存: ''ipconfig /displaydns'', 清空 dns 缓存:''ipconfig /flushdns''   * 查看 dns 缓存: ''ipconfig /displaydns'', 清空 dns 缓存:''ipconfig /flushdns''
   * 查看端口占用 ''netstat -ano'', 在 powershell 里可以用 ''netstat -ano | select-string LISTENING'' 来筛选只查看端口监听绑定   * 查看端口占用 ''netstat -ano'', 在 powershell 里可以用 ''netstat -ano | select-string LISTENING'' 来筛选只查看端口监听绑定
行 16: 行 23:
 certutil -hashfile <file-path-name> SHA256 certutil -hashfile <file-path-name> SHA256
 </code> </code>
 +  * 证书管理:当前用户 ''certmgr.msc'', 本地计算机 ''certlm.msc''
 +  * 命令行测试目标 NTP 服务可用性:''w32tm /stripchart /computer:<target_ip>''
 +  * 直接打开网络适配器:win+r运行 ''ncpa.cpl''
 +      * 在桌面设置快捷方式:右键桌面新建快捷方式,填入ncpa.cpl, 设置名称保存。
 +
 +  * 直接打开设备管理器:win+r运行 ''devmgmt.msc''
 ==== ◊ win10 tips ==== ==== ◊ win10 tips ====
   * 激活工具: {{ :public:it:win10_kms_activation-3_cn_hk_tw_en.zip |}}   * 激活工具: {{ :public:it:win10_kms_activation-3_cn_hk_tw_en.zip |}}
   * 多桌面设置,任务栏「任务视图」点开可以设置类似 mac 的多桌面,或者可以使用快捷键 ''CTRL + WIN + D'' 创建桌面,''CTRL + win + ←/→''切换桌面   * 多桌面设置,任务栏「任务视图」点开可以设置类似 mac 的多桌面,或者可以使用快捷键 ''CTRL + WIN + D'' 创建桌面,''CTRL + win + ←/→''切换桌面
   * 删除时提示「另一个程序正在使用此文件,进程无法访问。」时,可以打开「资源监视器」(可从任务管理器的性能页面左下角打开),在CPU页卡下「关联的句柄」那搜索,找到对应的进程来决定是否结束。   * 删除时提示「另一个程序正在使用此文件,进程无法访问。」时,可以打开「资源监视器」(可从任务管理器的性能页面左下角打开),在CPU页卡下「关联的句柄」那搜索,找到对应的进程来决定是否结束。
 +  * 显示器为DP/HDMI接口连接时,休眠唤醒或重启显示器后所有窗口跑到了左上角, 可[[https://hexingxing.cn/all-windows-run-to-the-upper-left-corner/|修改注册表]]解决此问题\
 +==== ◊ win11 tips ====
 +  * 取消任务栏某些图标重启后固定显示:编辑 ''C:\Users\<your-user-name\AppData\Local\Microsoft\Windows\Shell\LayoutModification.xml'', 找到 ''CustomTaskbarLayoutCollection'', 删除 ''<taskbar:TaskbarPinList>'' 里的相关项目,再在任务栏右键对应图标取消固定,下次重启就不会再回来。
  
 ===== BAT ===== ===== BAT =====
 +  * 这个指南不错:https://ss64.com/nt/syntax.html
   * 查看指令的路径的命令:''where <cmd>''   * 查看指令的路径的命令:''where <cmd>''
     * 在powershell里''where''是另外的object指令,要写全exe: ''where.exe <cmd>''     * 在powershell里''where''是另外的object指令,要写全exe: ''where.exe <cmd>''
行 77: 行 94:
 netsh advfirewall -? netsh advfirewall -?
 </code> </code>
 +  * 进入脚本文件本身所在目录:<code Winbatch>
 +: enter the folder of this file
 +cd %~dp0
 +</code>
 +  * cmd 设置别名使用 ''doskey /?'', 例如 ''doskey ls=dir $*''
 +  * cmd 设置初始自动运行脚本:[[https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc779439(v=ws.10)|AutoRun]]<code Winbatch>reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun ^
 +  /t REG_EXPAND_SZ /d "%"USERPROFILE"%\init.cmd" /f</code>
 +  * 如果 bat 脚本里有中文并且编码为UTF8,需设置代码页确保在cmd里可执行:<code Winbatch>@echo off
 +chcp 65001 </code>
  
 ===== SDK ===== ===== SDK =====
行 127: 行 153:
   * IE控件去掉滚动条,网上说在 body 元素里添加 ''style="overflow: hidden"'' 是不符合 w3c 标准的,在加载声明 Doctype w3c 标准的页面时, 顶级 html 元素就是''<html>''. 所以, 直接在 html 标签里修改 overflow 就可以正确屏蔽滚动条.   * IE控件去掉滚动条,网上说在 body 元素里添加 ''style="overflow: hidden"'' 是不符合 w3c 标准的,在加载声明 Doctype w3c 标准的页面时, 顶级 html 元素就是''<html>''. 所以, 直接在 html 标签里修改 overflow 就可以正确屏蔽滚动条.
   * 嵌套子进程窗口直接用 ''::SetParent'' 就可。   * 嵌套子进程窗口直接用 ''::SetParent'' 就可。
 +  * 修改文件夹权限:[[https://www.cnblogs.com/whwywzhj/p/8438787.html|参考博文]]
 +    * ''GetNamedSecurityInfo'' 获取DACL
 +    * ''SetEntriesInAcl'', ''SetNamedSecurityInfo ''
 +    * [[https://stackoverflow.com/questions/2686096/c-get-username-from-process|获取当前登录用户名]]:  从 explorer.exe 获取 token ''OpenProcessToken'', ''GetTokenInformation'', ''LookupAccountSid'' 
  
 ==== ◊ 一些坑 ==== ==== ◊ 一些坑 ====
行 150: 行 180:
   * [[https://chocolatey.org/|Chocolatey]] : windows 的软件管理器   * [[https://chocolatey.org/|Chocolatey]] : windows 的软件管理器
   * [[https://github.com/microsoft/winget-cli|winget]]: 微软自己弄的软件管理器    * [[https://github.com/microsoft/winget-cli|winget]]: 微软自己弄的软件管理器 
 +  * [[https://scoop.sh|scoop]]: 命令行包管理工具,相比 Chocolatey, 它的安装文件都处于 ''~\scoop'' 下。
 +  * [[https://www.nirsoft.net/utils/hash_my_files.html|hashmyfiles]]: 计算文件hash的小工具,支持右键菜单设置。
 +  * [[https://github.com/microsoft/Detours.git|Detours]] Hook 库
 ==== ◊ 任务管理器 ==== ==== ◊ 任务管理器 ====
   * [[http://www.cnblogs.com/walfud/articles/3256233.html|Windows 任务管理器中的几个内存概念]]   * [[http://www.cnblogs.com/walfud/articles/3256233.html|Windows 任务管理器中的几个内存概念]]
行 198: 行 231:
   * VC DEBUG工程默认定义的宏是 ''_DEBUG'' [[https://docs.microsoft.com/en-us/cpp/c-runtime-library/debug?view=msvc-160|MSDN]]   * VC DEBUG工程默认定义的宏是 ''_DEBUG'' [[https://docs.microsoft.com/en-us/cpp/c-runtime-library/debug?view=msvc-160|MSDN]]
   * 查看导出符号:在VS的 Tools 菜单打开''Visual Studio command prompt'', 执行命令 ''dumpbin /exports <target.dll|target.lib>''   * 查看导出符号:在VS的 Tools 菜单打开''Visual Studio command prompt'', 执行命令 ''dumpbin /exports <target.dll|target.lib>''
 +  * 远程调试[[https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging-cpp?view=vs-2022|remote-debugging-cpp]]
 ==== ◊ 配置相关 ==== ==== ◊ 配置相关 ====
   * 关于关机: 组策略 ''gpedit.msc'',本地组策略编辑器-计算机配置-管理模板-系统-关机选项   * 关于关机: 组策略 ''gpedit.msc'',本地组策略编辑器-计算机配置-管理模板-系统-关机选项
行 206: 行 240:
  
 ==== ◊ 驱动签名策略 ==== ==== ◊ 驱动签名策略 ====
-  * 微软公告:https://docs.microsoft.com/zh-cn/windows-hardware/drivers/install/kernel-mode-code-signing-policy--windows-vista-and-later-+  * [[https://docs.microsoft.com/zh-cn/windows-hardware/drivers/install/kernel-mode-code-signing-policy--windows-vista-and-later-|内核驱动策略]]: 从 Windows 10 版本1607开始,Windows 将不会加载开发人员门户未签名的任何新的内核模式驱动程序。 若要对驱动程序进行签名,请首先 [[https://docs.microsoft.com/zh-cn/windows-hardware/drivers/dashboard/register-for-the-hardware-program|注册 Windows 硬件开发人员中心计划]]。 请注意,需要使用 [[https://docs.microsoft.com/zh-cn/windows-hardware/drivers/dashboard/get-a-code-signing-certificate|EV 代码签名证书]] 来建立仪表板帐户。
   * [[https://docs.microsoft.com/zh-cn/windows-hardware/drivers/dashboard/create-a-new-hardware-submission|提交指南]]   * [[https://docs.microsoft.com/zh-cn/windows-hardware/drivers/dashboard/create-a-new-hardware-submission|提交指南]]
   * 提交入口:https://partner.microsoft.com/en-us/dashboard/directory   * 提交入口:https://partner.microsoft.com/en-us/dashboard/directory
  • public/it/windows.1633744706.txt.gz
  • 最后更改: 2021/10/09 09:58
  • oakfire