windows系统bat批处理 执行后 隐藏批处理本身
@echo off if "%1"=="h" goto begin start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit :begin ::以下为正常批处理命令,不可含有pause set/p等交互命令
比如我今天写的一个开机一键启动程序的脚本
@echo off if "%1"=="h" goto begin start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit :begin start/d "C:\Program Files (x86)\software\WeChat" WeChat.exe start/d "C:\Program Files (x86)\software\WXWork" WXWork.exe start/d "C:\Program Files (x86)\software\DingDing" DingtalkLauncher.exe start/d "C:\Program Files (x86)\software\Dict" YoudaoDict.exe start/d "C:\Program Files (x86)\software\Netease\MailMaster" Application\mailmaster.exe start/d "C:\Program Files (x86)\software\TIM\Bin" QQScLauncher.exe start/d "C:\Program Files (x86)\software\Everything" Everything.exe exit