找回密码
 加入
搜索
查看: 3733|回复: 10

[AU3基础] 关于FileInstall()函数的用法

  [复制链接]
发表于 2012-8-10 20:03:15 | 显示全部楼层 |阅读模式
在网上找到了带参数运行的案例
想着用FileInstall装入文件到脚本

但是发现无论参数正确或者错误
文件都会解压

求大神提供思路

以下是小弟的源码
Local $b = FileInstall("C:\Users\Administrator\Desktop\install.exe",@ScriptDir & "\install.exe",1)

If $CmdLine[0] > 0 Then
        If $CmdLine[1] = "/s" Then _main0()                
        If $CmdLine[1] = "/run" Then _main1()
Else
        _main()
EndIf

Func _main0()
;程序代码
EndFunc

Func _main1()
;程序代码
EndFunc

Func _main()
;程序代码
EndFunc
发表于 2012-8-10 20:24:23 | 显示全部楼层
$CmdLine[0]这个是什么
发表于 2012-8-10 20:40:17 | 显示全部楼层
If $CmdLine[0] > 0 Then
        If $CmdLine[1] = "/s" Then  ;Install ? 
            FileInstall("C:\Users\Administrator\Desktop\install.exe",@ScriptDir & "\install.exe",1)
             _main0()                
        ElseIf $CmdLine[1] = "/run" Then ;Run ?
             Run(@ScriptDir & "\install.exe")
             _main1()
         Else
              ;The Command Line Parameter is error
         EndIf
Else
        _main()
EndIf

Func _main0()
;程序代码
EndFunc

Func _main1()
;程序代码
EndFunc

Func _main()
;程序代码
EndFunc
发表于 2012-8-10 20:47:44 | 显示全部楼层
回复 3# ajian55

这个能运行?
发表于 2012-8-10 21:06:01 | 显示全部楼层
本帖最后由 ajian55 于 2012-8-10 21:13 编辑

回复 4# netegg


    为什么觉得不能运行呢 ?  可以的呀。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2012-8-10 21:06:58 | 显示全部楼层
本帖最后由 netegg 于 2012-8-10 21:10 编辑

$CmdLine[0]哪来的?

知道了
发表于 2012-8-10 21:15:05 | 显示全部楼层
回复 6# netegg


    蛋蛋开始没转过弯来吧   楼主很蛋疼的说~
 楼主| 发表于 2012-8-10 22:21:32 | 显示全部楼层
回复 7# ajian55


    谢谢啦~
一个不小心在C盘运行了个清空目录的操作
等电脑里的文件找回来再试试~ 
 楼主| 发表于 2012-8-11 14:06:06 | 显示全部楼层
回复 7# ajian55


    非常完美~谢谢啦~
发表于 2012-8-12 14:34:25 | 显示全部楼层
菜鸟路过,学习了。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-20 11:49 , Processed in 0.086875 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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