- @echo off&color 0e
- echo/&echo 读取开机启动项代码
-
- reg query "hklm\software\wow6432node">nul 2>nul&&(echo/&echo 读取系统64位开机启动项
- for /f "tokens=1,* delims=(" %%i in ('reg query "hklm\software\wow6432node\microsoft\windows\currentversion\run" /z') do (
- for /f "tokens=1,* delims=) " %%k in ('echo=%%j') do (
- if "%%k"=="1" echo=字符串值: %%~dpnxl
- if "%%k"=="3" echo=二进制值: %%~dpnxl
- if "%%k"=="4" echo=dword[32-bit]值: %%~dpnxl
- if "%%k"=="11" echo=dword[64-bit]值: %%~dpnxl
- if "%%k"=="7" echo=多字符串值: %%~dpnxl
- if "%%k"=="2" echo=可扩充字符串值: %%~dpnxl
- ))
- )
- echo/&echo 读取系统开机启动项
- for /f "tokens=1,* delims=(" %%i in ('reg query "hklm\software\microsoft\windows\currentversion\run" /z') do (
- for /f "tokens=1,* delims=) " %%k in ('echo=%%j') do (
- if "%%k"=="1" echo=字符串值: %%~dpnxl
- if "%%k"=="3" echo=二进制值: %%~dpnxl
- if "%%k"=="4" echo=dword[32-bit]值: %%~dpnxl
- if "%%k"=="11" echo=dword[64-bit]值: %%~dpnxl
- if "%%k"=="7" echo=多字符串值: %%~dpnxl
- if "%%k"=="2" echo=可扩充字符串值: %%~dpnxl
- ))
- echo/&echo 读取用户开机启动项
- for /f "tokens=1,* delims=(" %%i in ('reg query "hkcu\software\microsoft\windows\currentversion\run" /z') do (
- for /f "tokens=1,* delims=) " %%k in ('echo=%%j') do (
- if "%%k"=="1" echo=字符串值: %%~dpnxl
- if "%%k"=="3" echo=二进制值: %%~dpnxl
- if "%%k"=="4" echo=dword[32-bit]值: %%~dpnxl
- if "%%k"=="11" echo=dword[64-bit]值: %%~dpnxl
- if "%%k"=="7" echo=多字符串值: %%~dpnxl
- if "%%k"=="2" echo=可扩充字符串值: %%~dpnxl
- ))
- pause
复制代码 另外如何提取前边的值名,不用延迟变量,提取一晚了没提取出来,关键是值名称包含空格(多少个空格未知) |