autorun.inf只存在于根目录中。
其内容为固定格式:
open=sxs.exe
shell/auto/command=sxs
shell=auto
或者
open=sxs.exe -r
shell/auto/command=sxs.exe -r
shell=auto
或者
open=c:\sxs.exe -r
shell/auto/command=c:\sxs.exe -r
shell=auto
我的目的是截取sxs.exe,以及其路径(这个代码中暂时不需要路径)
------------------------------------
set "alldriver=c d e f g h"
set "vir=sxs.exe command.com ravmone.exe autorun.bat"
for %%i in (%alldriver%) do (
if exist %%i:\autorun.inf (
attrib -r -s -h %%i:\autorun.inf
for %%j in (%vir%) do (
echo %%j >>temp.txt
for /f "skip=1 tokens=2 delims== " %%k in (%%i:\autorun.inf) do (
echo %%~nxk----%%j >>temp.txt
if "%%~nxk"=="%%j" echo success >>temp.txt
)
)
)
)
Last edited by qingzangbasin on 2006-12-23 at 08:47 AM ]