BAT常用脚本汇总

1.取得时间戳

@echo off
set date0=%date:~0,10%
set hour0=%time:~0,2%
set time0=%time:~0,2%%time:~3,2%%time:~6,2%
if %hour0% lss 10 set set time0=%time:~1,7% 
if %hour0% gtr 9 set set time0=%time:~0,8%
set dttm=%date0:-=%%time0::=%
echo %dttm%

 

2.去除快捷方式小箭头(Win10测试通过)

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" /v 29 /d "%systemroot%\system32\imageres.dll,197" /t reg_sz /f
taskkill /f /im explorer.exe
attrib -s -r -h "%userprofile%\AppData\Local\iconcache.db"
del "%userprofile%\AppData\Local\iconcache.db" /f /q
start explorer
pause

 

posted on 2015-12-18 10:42  太清  阅读(2289)  评论(0编辑  收藏  举报