大概猜测了一下,不知道是不是这样!
$var = RegRead("HKEY_CURRENT_USER\Software\test", "Install Dir")
$path = "\Mirrors Edge"
Select
Case $var = ""
test()
Case $var = "E:\Mirrors Edge"
If FileExists($var) Then
MsgBox(0,"提示","注册表路径已存在且完全正确")
Else
test()
EndIf
Case Else
test()
EndSelect
Func test()
$Drive = DriveGetDrive( "all" )
For $i = 1 to $Drive[0]
If FileExists($Drive[$i] & $path) Then
If $Drive[$i] = "e:" Then ContinueLoop
RegWrite('HKEY_CURRENT_USER\Software\test')
RegWrite('HKEY_CURRENT_USER\Software\test', 'Install Dir', 'REG_SZ', $Drive[$i] & $path)
EndIf
Next
EndFunc
|