找回密码
 加入
搜索
查看: 1440|回复: 3

注册表命令的疑问和驱动安装选择工具代码解读

[复制链接]
发表于 2009-4-17 10:49:03 | 显示全部楼层 |阅读模式
$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

不好意思,本机上上不了网,只能用公用电脑,所以只能复制代码,不能把整个脚本弄上来,代码看起来有点乱,抱歉!!
想请教下,上面这段代码的运行思路大概是怎么样的??期待达人帮忙分析下,谢谢!!!
 楼主| 发表于 2009-4-17 15:06:11 | 显示全部楼层
貌似代码真的很糟糕,害大家没兴趣研究!!!哎!!!!
发表于 2009-7-22 10:24:40 | 显示全部楼层
写入注册表用iniwrite也可以
其他的代码大概意思就是写个GUI,打包需要文件,判断情况后执行删除文件和写入注册表等操作
发表于 2012-11-6 11:26:13 | 显示全部楼层
是的支持了嘿嘿
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-29 19:17 , Processed in 0.102028 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表