Hi,
vielleicht läuft es ja so:
Spoiler anzeigen
#include <string.au3>
#include <GUIConstants.au3>
Run("regedit /s D:\SoftM_Start\Reg\Alkor_Suite_T0.reg") ;Warum nicht gleich alle Reg-Keys per AutoIt schreiben???
[/autoit] [autoit][/autoit] [autoit]Dim $useridout
Dim $useridin
Dim $useridstd
Dim $useridSoftm
Dim $userpass
Dim $userpassver
Dim $userpassent
Dim $userpassreg
Dim $NameAS400
Dim $DLL
Dim $Temp
Dim $FehlerCode
Dim $nMsg
Dim $start_B
$NameAS400 = RegRead("HKEY_CURRENT_USER\Software\SoftM\Global\Parametersteuerung", "System")
$useridout = RegRead("HKEY_CURRENT_USER\Software\IBM\Client Access Express\CurrentVersion\Environments\My Connections\"& $NameAS400 &"\Communication", "User ID")
$useridstd = RegRead("HKEY_CURRENT_USER\Software\IBM\Client Access Express\CurrentVersion\Environments\My Connections\"& $NameAS400 &"\Communication", "Signon Mode")
$useridsoftm = RegRead("HKEY_CURRENT_USER\Software\SoftM\Global\Environment", "StandardUser")
$userpassreg = RegRead ( "HKEY_CURRENT_USER\Software\IBM\Client Access Express\CurrentVersion\Environments\My Connections\"& $NameAS400 &"\Communication" ,"User PW")
If ($useridsoftm = "" and $useridout = "") or ($useridsoftm = "" and $useridout <> "") Then
;Opt("GUIOnEventMode", 1) ; Wechsle in den OnEvent Modus
GUICreate("Anmeldung AS/400", 200, 200)
GUICtrlCreateLabel("AS/400 UserName:", 42, 35, 131, 27)
$useridin = GUICtrlCreateInput("", 42, 50, 121, 21)
GUICtrlCreateLabel("AS/400 Passwort:", 42, 85, 111, 17)
$userpass = GUICtrlCreateInput("", 42, 100, 121, 21)
$okbutton = GUICtrlCreateButton("OK", 70, 145, 60)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $okbutton
_start($NameAS400, GUICtrlRead($useridin), GUICtrlRead($userpass))
EndSwitch
WEnd
Else
if $NameAS400<>"" and $userpassreg And $useridout<>"" Then
_start($NameAS400,$useridout,_StringEncrypt(0,$userpassreg,"passwortencrypten",2)) ;Ich hoffe ich habe die Variablen sinngemäss benutzt.
EndIf
EndIf
Func _start($NameAS400, $useridin, $userpass)
RegWrite ( "HKEY_CURRENT_USER\Software\IBM\Client Access Express\CurrentVersion\Environments\My Connections\"& $NameAS400 &"\Communication" ,"User ID", "REG_SZ", $useridin)
ShellExecute("C:\Program Files\IBM\Client Access\cwblogon.exe", " " & $NameAS400 & " /u " & $useridin & " /p " & $userpass,@SW_HIDE)
$userpassver = _StringEncrypt(1, $userpass, "passwortencrypten", 2)
RegWrite ( "HKEY_CURRENT_USER\Software\IBM\Client Access Express\CurrentVersion\Environments\My Connections\"& $NameAS400 &"\Communication" ,"User PW", "REG_SZ", $userpassver)
;ShellExecute($run, '', '', '', @SW_HIDE)
EndFunc ;==>_start
Gruss
eddy_erpel