Windows 命令提示符使用

2019-08-05 Monday

Windows 命令提示符使用技巧总结

凭据管理

rundll32.exe keymgr.dll,KRShowKeyMgr
1

参考:How do I clear cached credentials from my Windows Profile? (opens new window)

Windows 下计算 MD5

certutil -hashfile filename MD5
certutil -hashfile filename SHA1
certutil -hashfile filename SHA256
1
2
3

参考:Windows下查看文件MD5值 (opens new window)

PDF 白边切割

使用briss (opens new window)

参考:如何解决六寸的 Kindle 看扫描版 PDF 的问题? (opens new window)

Bat获取日期和时间以及函数调用

@echo off

For /f "tokens=1-3 delims=/ " %%a in ('date /t') do (set mydate=%%a%%b%%c)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)
set "YMD=%mydate%_%mytime%"
CALL:Backup %YMD% gogs_win
exit
GOTO:EOF

:Backup 
echo "Time: "%1
echo "Schema: "%2
GOTO:EOF
1
2
3
4
5
6
7
8
9
10
11
12
13

参考:

Powershell 启用执行权限

get-executionpolicy
set-executionpolicy remotesigned
1
2

参考:PowerShell因为在此系统中禁止执行脚本解决方法 (opens new window)

静态路由

双网卡主机,一个网卡连内网,另一个直连外网。

设置临时静态路由表:

route delete 0.0.0.0
route add 0.0.0.0 mask 0.0.0.0 192.168.1.1
route add 192.168.2.0 mask 255.255.255.0 192.168.2.101
1
2
3

参考:

Windows IPv6 固定后缀

启用方法

  1. 通过Powershell
Set-NetIPv6Protocol -RandomizeIdentifiers Disabled
1
  1. 通过命令行
netsh interface ipv6 set global randomizeidentifiers=disable
1

参考

最近更新: 2023-04-29 23:16:58