找回密码
 加入
搜索
查看: 1697|回复: 2

[AU3基础] 更改用户名的代码怎么写

[复制链接]
发表于 2010-9-3 11:44:52 | 显示全部楼层 |阅读模式
我在写软件自动安装代码,里面有用户,公司等。
原来是:
用户=微软用户
公司=微软公司

现在我想把他改成其他的如:
用户=11
公司=22

代码要怎么写
或者说用什么代码可以清除他默认的
发表于 2010-9-3 13:04:03 | 显示全部楼层
Func _SetComputerName($Hostname);设置计算机名和描述
        $SetKey1 = "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001"
        $CtrlKey = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet"
        $Return = RegWrite($SetKey1 & "Control\ComputerName\ComputerName", "ComputerName", "REG_SZ", $Hostname)
        RegWrite($SetKey1 & "Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $Hostname)
        RegWrite($SetKey1 & "Services\Tcpip\Parameters", "Hostname", "REG_SZ", $Hostname)
        RegWrite($CtrlKey & "Control\ComputerName\ComputerName", "ComputerName", "REG_SZ", $Hostname)
        RegWrite($CtrlKey & "Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $Hostname)
        RegWrite($CtrlKey & "Services\Tcpip\Parameters", "Hostname", "REG_SZ", $Hostname)
        Return $Return
EndFunc   ;==>_SetComputerName

_SetComputerName("11")
 楼主| 发表于 2010-9-3 13:38:57 | 显示全部楼层
谢谢回复,可我不是要的这样的效果
我的是这样的
Run("setup.exe")
WinWait("Ulead MediaStudio Pro - InstallShield Wizard","The InstallShield Wizard will install Ulead MediaStudio Pro 8.0 on your computer.  To continue, click Next.")
ControlClick("Ulead MediaStudio Pro - InstallShield Wizard","The InstallShield Wizard will install Ulead MediaStudio Pro 8.0 on your computer.  To continue, click Next.","Button1")
WinWait("Ulead MediaStudio Pro - InstallShield Wizard","Ulead Systems Inc.")
ControlClick("Ulead MediaStudio Pro - InstallShield Wizard","Ulead Systems Inc.","Button2")
WinWait("Ulead MediaStudio Pro - InstallShield Wizard","Enter your registration information")
ControlClick("Ulead MediaStudio Pro - InstallShield Wizard","Enter your registration information","Edit3")
Send("222A2","Edit3")
ControlClick("Ulead MediaStudio Pro - InstallShield Wizard","Enter your registration information","Edit4")
Send("28000","Edit4")
ControlClick("Ulead MediaStudio Pro - InstallShield Wizard","Enter your registration information","Edit5")
Send("08650276","Edit5")
ControlClick("Ulead MediaStudio Pro - InstallShield Wizard","Enter your registration information","Button2")
WinWait("Ulead MediaStudio Pro - InstallShield Wizard","Setup will install Ulead MediaStudio Pro 8.0 in the following folder")
ControlClick("Ulead MediaStudio Pro - InstallShield Wizard","Setup will install Ulead MediaStudio Pro 8.0 in the following folder","Button3")
WinWait("Choose Folder","Please select the installation folder.")
ControlFocus("SChoose Folder", "Please select the installation folder.", "Edit1")
ControlSend("SChoose Folder", "Please select the installation folder.", "Edit1", "D:\Program Files\Ulead Systems\Ulead MediaStudio Pro 8.0")
ControlClick("Choose Folder","Please select the installation folder.","Button1")
WinWait("Ulead MediaStudio Pro - InstallShield Wizard","Setup will install Ulead MediaStudio Pro 8.0 in the following folder")

一个就是上面的问题
一个就是无法改变安装路径
刚学不懂,望大家教我下,我先谢了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-15 02:30 , Processed in 0.113764 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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