date | author | title | url | tags | categories | index | toc | draft | |||
---|---|---|---|---|---|---|---|---|---|---|---|
2020-10-11 22:23:19 +0800 |
Rustle Karl |
Windows 常用命令行命令 |
posts/windows/docs/scripts |
|
|
true |
true |
false |
powercfg -h on
powercfg /a
certutil -hashfile file_path MD5
taskkill /f /im explorer.exe
explorer.exe
cmd 下有效
DEL /F/Q/S *.*
rmdir -r "c:/path/to/folder/*/*/*.url"
rmdir -r "./*/*.url"
rmdir -r "c:/path/to/folder/*/*/*.txt"
robocopy "e:/OneDrive" "h:/OneDrive" /s /mt:32
- /s 复制子目录,但不复制空的子目录
- /e 复制子目录,包括空的子目录
- /b 在备份模式下复制文件
- /xf 排除与给定名称/路径/通配符匹配的文件
- /xd 排除与给定名称/路径匹配的目录
- /mov 移动文件
- /move 移动文件和目录
- /r:3 失败副本的重试次数
- /w:3 两次重试间的等待时间
- /eta 显示复制文件的预期到达时间
- /mt:32 启动多线程任务
@echo off
rem 强制以管理员身份运行
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
cd /d "%~dp0"
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\installutil.exe XXXX.exe
Net Start XXXX
sc config XXXX start= auto
@echo off
rem 强制以管理员身份运行
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
cd /d "%~dp0"
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\installutil.exe /u XXXX.exe
程序异常退出会不断重启。
SC failure 服务名 reset= 0 actions= restart/0/restart/0/restart/0
SC failure AAAAAAAAA reset= 0 actions= restart/0/restart/0/restart/0
SC delete 服务名
SC delete AAAAAAAAA
code $profile
& $profile
. $profile
set-ExecutionPolicy RemoteSigned
ping localhost /t