初学者请求修正在DOS下运行老出现提示变量错误,希望得到帮助
在DOS下运行这个编译后的程序老提示变量错误,万分苦恼中,请能帮忙修正,谢谢,附上源码:#Region ;**** 参数创建于 ACNWrapper_GUI ****#AutoIt3Wrapper_icon=Icon_2.ico
#AutoIt3Wrapper_Res_Comment=FZ_Deploy
#AutoIt3Wrapper_Res_Description=FZ_Deploy
#AutoIt3Wrapper_Res_Fileversion=2010.5.26.0
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
_Deploy_WinXP_Main()
Exit
#include<guiconstants.au3>
Func _Deploy_WinXP_Main()
;通过读取系统变量获取系统盘盘符
GUICreate("",@DesktopWidth,@DesktopHeight,"","",$ws_popup)
GUICtrlCreatePic(@SystemDir&"\sysprep\Deploy.bmp",0,0,@DesktopWidth,@DesktopHeight,BitOR($ss_notify,$ws_group,$ws_clipsiblings))
GUISetState(@SW_SHOW)
Local $SystemDrive=EnvGet("SystemDrive")
;部署前调用
RunWait($SystemDrive&"\sysprep\ComputerReName.exe")
RunWait($SystemDrive&"\sysprep\drivers\EasyDrv3.5..exe")
;删除 CMDLine键值
RegDelete("HKEY_LOCAL_MACHINE\SYSTEM\setup","cmdline")
;执行最小化系统部署
RunWait($SystemDrive&"\Windows\System32\Setup.exe -newsetup -mini")
;写入RunOnce键值以在注册组件调用运行fz_oper.exe和写入run键值以在进入桌面后运行调用fz_run.exe
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce","oper","REG_SZ",@WindowsDir&"\fz_oper.exe")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","oper","REG_SZ",@WindowsDir&"\fz_run.exe")
;恢复默认备份boot_NTLDR_Bootfont.bin
RunWait($SystemDrive&"\sysprep\boot.exe")
EndFunc 回复 8# 59406
哦,应该没有问题呀,
5楼中GUICtrlCreatePic(@SystemDir&"\sysprep\Deploy.bmp",0,0,@DesktopWidth,@DesktopHeight,BitOR($ss_notify,$ws_group,$ws_clipsiblings))这里位置应该在system或system32\sysprep\Deploy.bmp 下,经测试很正常,可能你的图片路径貌似不对吧!我把图片放在"c:\windows\system32\sysprep“目录下!!!测试的
如果想在C:\sysprep\Deploy.bmp的话,那请用@HomeDrive
改为GUICtrlCreatePic(@HomeDrive&"\sysprep\Deploy.bmp",0,0,@DesktopWidth,@DesktopHeight,BitOR($ss_notify,$ws_group,$ws_clipsiblings))自由天空那不回帖了 _Deploy_WinXP_Main()
Exit
#include<guiconstants.au3>把上面几行的位置调换一下试试看(没测试,不知道对否)#include<guiconstants.au3>
_Deploy_WinXP_Main()
Exit 回复 2# 破帽遮颜
感谢破帽兄弟,我试一下再反馈 同意一楼的! #Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=Icon_2.ico
#AutoIt3Wrapper_Res_Comment=FZ_Deploy
#AutoIt3Wrapper_Res_Description=FZ_Deploy
#AutoIt3Wrapper_Res_Fileversion=2010.5.26.0
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
_Deploy_WinXP_Main()
Exit
Func _Deploy_WinXP_Main()
;通过读取系统变量获取系统盘盘符
GUICreate("",@DesktopWidth,@DesktopHeight,"","",$ws_popup)
GUICtrlCreatePic(@SystemDir&"\sysprep\Deploy.bmp",0,0,@DesktopWidth,@DesktopHeight,BitOR($ss_notify,$ws_group,$ws_clipsiblings))
GUISetState(@SW_SHOW)
Local $SystemDrive=EnvGet("SystemDrive")
;部署前调用
RunWait($SystemDrive&"\sysprep\ComputerReName.exe")
RunWait($SystemDrive&"\sysprep\drivers\EasyDrv3.5..exe")
;删除 CMDLine键值
RegDelete("HKEY_LOCAL_MACHINE\SYSTEM\setup","cmdline")
;执行最小化系统部署
RunWait($SystemDrive&"\Windows\System32\Setup.exe -newsetup -mini")
;写入RunOnce键值以在注册组件调用运行fz_oper.exe和写入run键值以在进入桌面后运行调用fz_run.exe
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce","oper","REG_SZ",@WindowsDir&"\fz_oper.exe")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","oper","REG_SZ",@WindowsDir&"\fz_run.exe")
;恢复默认备份boot_NTLDR_Bootfont.bin
RunWait($SystemDrive&"\sysprep\boot.exe")
EndFunc 我也在自由天空回复了,答案是一样的,不要见怪,lccw0588也是我的号,原来有lchl0588注册时间更早,密没记住,故一直用lccw0588 是这行出错吗?
RunWait($SystemDrive&"\sysprep\drivers\EasyDrv3.5..exe") 回复 6# lchl0588
原来也是自由天空的了,太感谢了,我试了你的修改,不报变量出错了,但我调用的图片呈了灰白色一片,不知是哪 又出错了,,谢谢 是这行出错吗?
RunWait($SystemDrive&"\sysprep\drivers\EasyDrv3.5..exe")
3mile 发表于 2010-6-7 08:52 http://www.autoitx.com/images/common/back.gif
不是,驱动程序已经启动运行, 下午确实是改那个就成功了,@HomeDrive
感谢指导
页:
[1]