找回密码
 加入
搜索
查看: 2892|回复: 9

[AU3基础] 用一键4区源码问题

  [复制链接]
发表于 2010-11-3 07:04:31 | 显示全部楼层 |阅读模式
本帖最后由 lht27829 于 2010-11-3 08:06 编辑

这个是源码Dim $CDRom,$i,$Target,$Drive,$Flag,$Flagr,$Flagrr
$Flag=MsgBox(1,"系统安装","确认要将硬盘分为4个区吗?这会删除当前硬盘所有数据!")
If $Flag=2 Then
Exit
EndIf
$Target="hd-4.gho"
For $i=90 To 67 Step -1
$Drive=Chr($i)
If FileExists($Drive ":\GHOST\" & $Target) Then
$CDRom=$Drive ":"
ExitLoop
EndIf
Next
If FileExists($CDRom) Then
If FileExists($CDRom "\PESOFT\GHOST\Ghost32.exe") And FileExists($CDRom & "\ghost\hd-4.gho") Then
ToolTip(@CR" 正在执行一键四区,请稍候... "&@CR, @DesktopWidth-220, @DesktopHeight-120)
Run($CDRom "\PESOFT\GHOST\Ghost32.exe -nousb -clone,mode=load,src=" & $CDRom & "\ghost\hd-4.gho,dst=1 -fx")
ProcessWaitClose("Ghost32.exe")
ToolTip("")
$Flagr=MsgBox(1,"系统安装","硬盘分区完成,要立即安装XP系统到C盘吗?")
If $Flagr=2 Then
Exit
EndIf
IF FileExists($CDRom "\ghost\winxp.gho") Then
ToolTip(@CR" 正在执行恢复XP到C盘,请稍候... "&@CR, @DesktopWidth-260, @DesktopHeight-120)
Run($CDRom "\PESOFT\GHOST\Ghost32.exe -nousb -clone,mode=pload,src=" & $CDRom & "\ghost\winxp.gho:1,dst=1:1 -crcignore -sure -fx")
ProcessWaitClose("Ghost32.exe")
ToolTip("")
$Flagrr=MsgBox(1,"系统安装","系统文件复制完成,请重启电脑完成安装",5)
If $Flagrr=2 Then
Exit
EndIf
Run(@ComSpec " /c " & 'pecmd shut r', "", @SW_HIDE)
Else
MsgBox(0,"Error","未发现winxp.gho镜像文件!")
Exit
EndIf
ElseIf Not FileExists($CDRom "\PESOFT\GHOST\Ghost32.exe") Then
MsgBox(0,"Error","未发现Ghost32.exe程序!")
Exit
EndIf
Else
MsgBox(0,"Error","未发现HD-4.GHO镜像文件!")
Exit
EndIf

用这个源码出现以下错误 怎么解决



E:\新建 AutoIt v3 脚本.au3(9,32) : 错误: 表达式错误
If FileExists($Drive ":\GHOST\"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
E:\新建 AutoIt v3 脚本.au3(10,18) : 错误: 表达式错误
$CDRom=$Drive ":"
~~~~~~~~~~~~~~~~~^
E:\新建 AutoIt v3 脚本.au3(15,49) : 错误: 表达式错误
If FileExists($CDRom "\PESOFT\GHOST\Ghost32.exe"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
E:\新建 AutoIt v3 脚本.au3(16,42) : 错误: 表达式错误
ToolTip(@CR" 正在执行一键四区,请稍候... "
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
E:\新建 AutoIt v3 脚本.au3(17,68) : 错误: 表达式错误
Run($CDRom "\PESOFT\GHOST\Ghost32.exe -nousb -clone,mode=load,src="
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
E:\新建 AutoIt v3 脚本.au3(24,40) : 错误: 表达式错误
IF FileExists($CDRom "\ghost\winxp.gho"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
E:\新建 AutoIt v3 脚本.au3(25,46) : 错误: 表达式错误
ToolTip(@CR" 正在执行恢复XP到C盘,请稍候... "
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
E:\新建 AutoIt v3 脚本.au3(26,69) : 错误: 表达式错误
Run($CDRom "\PESOFT\GHOST\Ghost32.exe -nousb -clone,mode=pload,src="
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
E:\新建 AutoIt v3 脚本.au3(33,20) : 错误: 表达式错误
Run(@ComSpec " /c "
~~~~~~~~~~~~~~~~~~~^
E:\新建 AutoIt v3 脚本.au3(38,57) : 错误: 表达式错误
ElseIf Not FileExists($CDRom "\PESOFT\GHOST\Ghost32.exe"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
E:\新建 AutoIt v3 脚本.au3 - 10 error(s), 0 warning(s)
发表于 2010-11-3 07:22:59 | 显示全部楼层
没看后面的
$cdrom ---->$cdrom &
@cr ----> @cr &
@comspec ----->@comspec &
$drive ----> $drive &
 楼主| 发表于 2010-11-3 08:05:49 | 显示全部楼层
没看后面的
$cdrom ---->$cdrom &
@cr ----> @cr &
@comspec ----->@comspec &
$drive ----> $drive  ...
netegg 发表于 2010-11-3 07:22



谢谢你!!
 楼主| 发表于 2010-11-3 09:22:10 | 显示全部楼层
出现新的问题了 老提示没找到 hd-4.gho
发表于 2010-11-3 10:09:41 | 显示全部楼层
路过,不太懂。
发表于 2010-11-3 10:16:50 | 显示全部楼层
回复 4# lht27829


你确定文件存在,并且路径完全正确!
 楼主| 发表于 2010-11-3 10:53:54 | 显示全部楼层
存在 路径都对啊
发表于 2010-11-3 13:00:42 | 显示全部楼层
$Drive ":\GHOST\" & $Target改了吗
$drive & ":\GHOST\" & $Target
 楼主| 发表于 2010-11-4 08:32:58 | 显示全部楼层
改了啊,还是不行啊!
发表于 2010-11-4 10:52:35 | 显示全部楼层
Dim $CDRom,$i,$Target,$Drive,$Flag,$Flagr,$Flagrr
$Flag=MsgBox(1,"系统安装","确认要将硬盘分为4个区吗?这会删除当前硬盘所有数据!")
If $Flag=2 Then
Exit
EndIf
$Target="hd-4.gho"
For $i=90 To 67 Step -1
$Drive=Chr($i)
If FileExists($Drive & ":\GHOST\" & $Target) Then
$CDRom=$Drive & ":"
ExitLoop
EndIf
Next
If FileExists($CDRom) Then
If FileExists($CDRom & "\PESOFT\GHOST\Ghost32.exe") And FileExists($CDRom & "\ghost\hd-4.gho") Then
ToolTip(@CR & " 正在执行一键四区,请稍候... " & @CR, @DesktopWidth-220, @DesktopHeight-120)
Run($CDRom & "\PESOFT\GHOST\Ghost32.exe -nousb -clone,mode=load,src=" & $CDRom & "\ghost\hd-4.gho,dst=1 -fx")
ProcessWaitClose("Ghost32.exe")
ToolTip("")
$Flagr=MsgBox(1,"系统安装","硬盘分区完成,要立即安装XP系统到C盘吗?")
If $Flagr=2 Then
Exit
EndIf
IF FileExists($CDRom & "\ghost\winxp.gho") Then
ToolTip(@CR & "正在执行恢复XP到C盘,请稍候... " & @CR, @DesktopWidth-260, @DesktopHeight-120)
Run($CDRom & "\PESOFT\GHOST\Ghost32.exe -nousb -clone,mode=pload,src=" & $CDRom & "\ghost\winxp.gho:1,dst=1:1 -crcignore -sure -fx")
ProcessWaitClose("Ghost32.exe")
ToolTip("")
$Flagrr=MsgBox(1,"系统安装","系统文件复制完成,请重启电脑完成安装",5)
If $Flagrr=2 Then
Exit
EndIf
Run(@ComSpec & " /c " & 'pecmd shut r', "", @SW_HIDE)
Else
MsgBox(0,"Error","未发现winxp.gho镜像文件!")
Exit
EndIf
ElseIf Not FileExists($CDRom & "\PESOFT\GHOST\Ghost32.exe") Then
MsgBox(0,"Error","未发现Ghost32.exe程序!")
Exit
EndIf
Else
MsgBox(0,"Error","未发现HD-4.GHO镜像文件!")
Exit
EndIf
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-15 10:11 , Processed in 0.072983 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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