下面是JM写的代码,可能对你有用!~
复制代码 代码如下:
@echooff
::考虑到程序并非都安装在系统盘下,所以还要用!str:~-1!来截取盘符
::如果路径中含有N个中文字符的话,此路径的最后N个字符将不显示(一个中文字符占两个字符位)
::codebyjm2006-7-27
setlocalenabledelayedexpansion
echo.
echo开机自启动的程序有:
echo.
for/f"skip=4tokens=1*delims=:"%%iin('regqueryHKLMSoftwareMicrosoftWindowsCurrentVersionRun')do(
setstr=%%i
setvar=%%j
set"var=!var:"=!"
ifnot"!var:~-1!"=="="echo!str:~-1!:!var!
)
pause>nul
复制代码 代码如下:
@ECHOOFF
SETRQ=REGQUERY
SETCU=HKEY_CURRENT_USER
SETLM=HKEY_LOCAL_MACHINE
SETFS=FINDSTR/V/B"!HKEY_"^|FINDSTR"."
SETWS=SoftwareMicrosoftWindowsCurrentVersion
SETWT=SoftwareMicrosoftWindowsNTCurrentVersion
SETCK=SYSTEMCurrentControlSetControlSessionManager
SETRT=LoadUserinitWindowsWinlogonShellRunOnceExPoliciesExplorerRunBootExecute
SETRP=ECHO-------------------------------------------------------------------------------
%RP%&ECHO%ALLUSERSPROFILE%^&%USERNAME%「开始」菜单程序启动
FOR%%iIN(ALLUSERSPROFILE;USERPROFILE)DOCALLDIR/B/S"%%%%i%%「开始」菜单程序启动"
%RP%
FOR/F"tokens=1-8delims=:"%%AIN('FINDSTR/B"::""%~nx0"')DO(
CALL:REGQUERY1%%A%%B%%C%%D%%E%%F%%G">NUL"
)
SET/A1/%~12>NUL&&GOTO:EOF
SET/pCONU=导出为文本文档?(Y/N):
ECHO%CONU%|FIND/I"N"1>NUL2<&1&&GOTO:EOF
CALL%~nx01>%~n0%.txt
ECHOfilelist:%~dpn0%.txt
PAUSE>NUL&"%~dpn0%.txt"
GOTO:EOF
::CUWT127V04
::LMWT198V48
::LMWT198V275
::CUWS323S00
::LMWS323S00
::CUWS327S00
::LMWS327S00
::CUWS329S00
::LMWS329S00
::CUWS4121S00
::LMWS4121S00
::LMCK00V6211
:REGQUERY
CALLSETPR=%%%~2%%%%%~3%%%%rt:~%~4,%~5%%&CALLSETPZ=%%rt:~%~7,%~8%%
ECHO[%PR%]%~9&%RQ%"%PR%"/%6%PZ%2>NUL|%FS%%~9&&%RP%&&SET/A1/%12>NUL&&CALL%00%2%3%4%5%6%7%8
GOTO:EOF