转载
http://mini.eastday.com/bdmip/180415170607009.html
@echo off
if not exist G:密码U盘.txt shutdown -s -t 1 -c "电脑马上关机咯,拜拜"
:Repeatif not exist G:密码U盘.txt goto Repeatshutdown -a
这时候不要保存为文本文件了,另存为“关机.bat”文件,注意扩展名一定要是bat文件。另外如果你的优盘盘符不是G,则需要根据实际情况修改为你优盘的盘符。