#Include <File.au3>
Dim $A,$B, $i = 1
While()
$ServerIP = IniRead(".\config.ini","Drive","IP" & $i,"NotFound")
$ServerPath = Iniread(".\config.ini","Drive","disk" & $i,"NotFound")
$UserName = Iniread(".\config.ini","Drive","user" & $i,"NotFound")
$UserPass = Iniread(".\config.ini","Drive","pass" & $i,"NotFound")
$PatchName = IniRead(".\config.ini","Drive","name" & $i,"NotFound")
$DriveName = IniRead(".\config.ini","Drive","drive" & $i,"NotFound")
$C=IniRead(".\config.ini","Drive","REGKEY","NotFound")
$D=IniRead(".\config.ini","Drive","KEYNAME","NotFound")
If $ServerIP = "NotFound" Then
RegWrite($C,$D,"REG_SZ","1")
_FileWriteLog("." & "\Drive Map.log","创建映射盘符失败")
ExitLoop
Else
$A=DriveMapAdd($DriveName&":","\"&$ServerIP&""&$ServerPath, 0, $PatchName&""&$UserName, $UserPass)
If $A=1 Then
RegWrite($C,$D,"REG_SZ","0") ; 若成功,创建键值为0
_FileWriteLog("." & "\Drive Map.log","创建映射盘符成功")
;MsgBox(4096, "CG", $A, 10)
Else
RegWrite($C,$D,"REG_SZ","1")
_FileWriteLog("." & "\Drive Map.log","创建映射盘符失败")
;MsgBox(4096, "sb", $A, 10)
EndIf
EndIf
$i += 1
WEnd
差不多就是这个意思,未经验证