问题描述
你好,这是我在这里的第一篇文章,所以我想我是这里的菜鸟!!
我正在做的是制作可移植版本的eset v4.2,以便在bootland的VistaPE磁盘中使用
我已经有这个加载程序的beta版本了
batsh文件(.bat)基本上会安装eset v4.2,然后运行它
功能之一是它可以从闪存驱动器中找到更新
这是更新程序的当前beta代码:
Hello this is my first post here so i guess i am a noob here!!
what im doing is making a portable version of eset v4.2 for use in a VistaPE disk at bootland
i already have a beta version of this loader working
the batsh file(.bat) basicly installs eset v4.2 and then runs it
one of the features is that it can find updates from a flash drive
here is the current beta code for the updater:
Echo looking for update files
if exist C:\nodv4_upd\update.ver set Drive=c:
if exist d:\nodv4_upd\update.ver set Drive=d:
if exist e:\nodv4_upd\update.ver set Drive=e:
if exist f:\nodv4_upd\update.ver set Drive=f:
if exist g:\nodv4_upd\update.ver set Drive=g:
if exist h:\nodv4_upd\update.ver set Drive=h:
if exist i:\nodv4_upd\update.ver set Drive=i:
if exist j:\nodv4_upd\update.ver set Drive=j:
if exist k:\nodv4_upd\update.ver set Drive=k:
if exist l:\nodv4_upd\update.ver set Drive=l:
if exist m:\nodv4_upd\update.ver set Drive=m:
if exist n:\nodv4_upd\update.ver set Drive=n:
if exist o:\nodv4_upd\update.ver set Drive=o:
if exist p:\nodv4_upd\update.ver set Drive=p:
if exist q:\nodv4_upd\update.ver set Drive=q:
if exist x:\nodv4_upd\update.ver set Drive=x:
echo updates found on %drive%
找到了回声更新
如您所见,找不到最新版本
所以我做了这个(未完成)
as you can see it dose not find the latest version
so i made this(unfinished)
:start
set drive=c
:repeat
set CHECK=no
if exist %drive%:\nodv4_upd\update.ver (set CHECK=Yes)
IF %CHECK%==no (echo %drive%: reports no) else (echo %drive%: reports Yes)
IF %CHECK%==yes (
goto %drive%
:c
set drive=d
goto repeat
:d
set drive=e
goto repeat
:e
set drive=f
goto repeat
:f
set drive=g
goto repeat
:g
set drive=h
goto repeat
:h
set drive=i
goto repeat
:i
set drive=j
goto repeat
:j
set drive=k
goto repeat
:k
set drive=l
goto repeat
:l
set drive=m
goto repeat
:m
set drive=n
goto repeat
:n
set drive=o
goto repeat
:o
set drive=p
goto repeat
:p
set drive=q
goto repeat
:q
set drive=r
goto repeat
:r
set drive=s
goto repeat
:s
set drive=t
goto repeat
:t
set drive=u
goto repeat
:u
set drive=v
goto repeat
:v
set drive=w
goto repeat
:w
set drive=x
goto repeat
:x
set drive=y
goto repeat
:y
set drive=z
goto repeat
:z
Echo done
pause
(我知道如何使用"for"命令,但在这里对我不起作用)
这是我的旧代码,用于检查eset 2.7的版本.
(i know how to use the "for" command but it will not work for me here)
here is my old code to check for versions for eset 2.7
echo Now checking Nod Update Versions...
for /f "skip=2 tokens=2 delims= " %%a in ('find "version:" nod32.000') do set nodver=%%a
echo Version: %nodver%
for /f "skip=2 tokens=3 delims= " %%a in ('find "version:" nod32.000') do set noddate=%%a
echo Date: %noddate%
echo Curent installed version
for /f "skip=2 tokens=2 delims= " %%a in ('find "version:" "%indir%\eset\nod32.000"') do set nodver2=%%a
echo Version: %nodver2%
for /f "skip=2 tokens=3 delims= " %%a in ('find "version:" "%indir%\eset\nod32.000"') do set noddate2=%%a
echo Date: %noddate2%
if "%nodver%"=="%nodver2%" goto bad5
if "%nodver%" LSS "%nodver2%" goto bad6
if "%nodver%" GTR "%nodver2%" echo The system needs to update
这是必须扫描以获取更新信息的文件
(update.ver)
here is the files it must scan to get the update info
(update.ver)
[ENGINE2]
version=4988 (20100331)
versionid=4988
build=6847
type=engine
level=2
base=6615
date=31.03.2010
category=engine
platform=x86
group=perseus,ra
buildregname=EngineBuild
file=em002_32_l2.nup
size=1532598
nuv=4.06.3
(update.ver#2)
(update.ver #2)
[ENGINE2]
version=5191 (20100611)
versionid=5191
build=7283
type=engine
level=2
base=7147
date=11.06.2010
category=engine
platform=x86
group=perseus,ra
buildregname=EngineBuild
file=em002_32_l2.nup
size=977966
nuv=4.06.9
(更新版本信息超过100行,所以我不会全部加载)
所以基本上我想做的是找到"[ENGINE2]"行并阅读其下的"version",以便我可以进行ver比较这些行
因为thare像" [ENGINE2](" [ENGINE0]," [ENGINE1]等)这样的很多行,它们随机放置在文件中的某个地方,所以我必须找到" [ENGINE2],所以我不能使用/f skip = 2!
而且我无法从"em002_32_l2.nup"文件中获取版本信息,因为它太大,将需要很长时间才能找到文件
请帮忙!
(the update ver info is over 100 lines long so i will not load it all)
so basicly what i want to do is to find the "[ENGINE2]" line and read the "version" below it so that i can make a ver to compare the lines
since thare is a lot off lines like ""[ENGINE2]"("[ENGINE0]","[ENGINE1]" ect)and they are randomly placed somewhere in the file i have to find "[ENGINE2]" so i cant use for /f skip=2!
And i cant get the version info from the "em002_32_l2.nup" file cos its too big and will take long to find the file
PLEASE help!!
推荐答案
这篇关于高级文件版本检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!