$reg = IniRead("Drtools.ini", "file", "reg", "NotFound")
RunWait(@ComSpec & ' /c regedit /s '& $reg &' >nul','', @SW_HIDE)
1.这两条语句将$reg注册表文件写入注册表,想请教下,写入之后在注册表的那个路径下可以找到??
下面这段代码的执行时个什么原理?这是论坛里一位达人写的驱动安装的源码,主要是下面这段运行操作吧!
If $file = "dir" Then
If $reg <> "" And FileExists($reg) Then RunWait(@ComSpec & ' /c regedit /s '& $reg &' >nul','', @SW_HIDE)
for $i=1 to 9
If GUICtrlRead(Eval("Check" & $i)) = $GUI_UNCHECKED Then DirMove(Eval("dir" & $i),Eval("dir" & $i) & "_")
next
ElseIf $file = "7z" Then
If $path = "" Then $path = @HomeDrive & "\driver"
FileInstall("7za.exe", @SystemDir & "\")
If $reg <> "" And FileExists($reg) Then RunWait(@ComSpec & ' /c regedit /s '& $reg &' >nul','', @SW_HIDE)
for $i=1 to 9
If GUICtrlRead(Eval("Check" & $i)) = $GUI_CHECKED Then RunWait(@ComSpec & ' /c 7za.exe x -y '& Eval("run" & $i) &' -o'& $path &'', @SystemDir, @SW_HIDE)
next
FileDelete(@SystemDir & "\za.exe")
ElseIf $file = "rar" Then
If $path = "" Then $path = @HomeDrive & "\driver"
FileInstall("unrar.exe",@SystemDir & "\")
If $reg <> "" And FileExists($reg) Then RunWait(@ComSpec & ' /c regedit /s '& $reg &' >nul','', @SW_HIDE)
for $i=1 to 9
If GUICtrlRead(Eval("Check" & $i)) = $GUI_CHECKED Then RunWait(@ComSpec & ' /c unrar.exe x -y -o+ '& Eval("run" & $i) &' '& $path &'\', @SystemDir, @SW_HIDE)
next
FileDelete(@SystemDir & "\unrar.exe")
ElseIf $file = "exe" Then
If $reg <> "" And FileExists($reg) Then RunWait(@ComSpec & ' /c regedit /s '& $reg &' >nul','', @SW_HIDE)
for $i=1 to 9
If GUICtrlRead(Eval("Check" & $i)) = $GUI_CHECKED And Eval("run" & $i) <> "" And FileExists(Eval("run" & $i)) Then RunWait(@ComSpec & ' /c '& Eval("run" & $i),'',@SW_HIDE)
next
不好意思,本机上上不了网,只能用公用电脑,所以只能复制代码,不能把整个脚本弄上来,代码看起来有点乱,抱歉!!
想请教下,上面这段代码的运行思路大概是怎么样的??期待达人帮忙分析下,谢谢!!! |