本帖最后由 huyou96 于 2016-10-25 12:51 编辑
Hi, everyone. 嗨,大家好。
暂时先这样啦:
CheckOS.bat- @echo off
- powershell -help > nul 1>nul 2>nul
- if not "%ErrorLevel%" equ "0" (
- echo Hi, I'm running in Windows RE or Windows PE
- echo 嗨,我正跑在Windows RE或Windows PE呢
- pause
- exit 0
- )
- :::::: reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Option > nul 1>nul 2>nul ::::::
- reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Option /v OptionValue /t Reg_DWord > nul 1>nul 2>nul
- if "%ErrorLevel%" equ "0" (
- echo Hi, I'm running in safe mode
- echo 嗨,我正跑在安全模式呢
- pause
- exit 0
- ) else (
- echo Hi, I'm running in normal mode
- echo 嗨,我正跑在正常模式呢
- pause
- exit 0
- )
复制代码 再谢flyinnet9大虾的指点!
也只能暂时这样咯……
以后有空再来完善它吧…… |