Hallo Zusammen,
ich habe folgendes Script:
Spoiler anzeigen
#include <GUIConstants.au3>
#Include <process.au3>
#include <string.au3>
dim $HiddenString, $PW
#Region ### START Koda GUI section ### Form=D:\Eigene Dateien\AutoIt-Skripte\DefragC\Def_GUI.kxf
$Form1 = GUICreate("TUV Defragger for PowerUsers (c) by PC-Service 2007", 440, 242, 307, 201)
GUISetBkColor(0x0000FF)
$Label1 = GUICtrlCreateLabel("Defragmentierung für Haupbenutzer", 8, 16, 436, 36)
GUICtrlSetFont(-1, 20, 400, 0, "Arial")
GUICtrlSetColor(-1, 0xFFFF00)
GUICtrlSetBkColor(-1, 0x0000FF)
$Admin_Input = GUICtrlCreateInput("Administrator", 208, 80, 220, 26)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
$PW_Input = GUICtrlCreateInput("kosmos", 208, 112, 220, 26, $ES_PASSWORD)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
$Label2 = GUICtrlCreateLabel("", 40, 48, 4, 4)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
GUICtrlSetColor(-1, 0xFFFF00)
GUICtrlSetBkColor(-1, 0x0000FF)
$Label3 = GUICtrlCreateLabel("Passwort?", 32, 112, 78, 22, $SS_RIGHT)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
GUICtrlSetColor(-1, 0xFFFF00)
GUICtrlSetBkColor(-1, 0x0000FF)
$Label4 = GUICtrlCreateLabel("Lokaler Administrator?", 32, 80, 162, 22)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
GUICtrlSetColor(-1, 0xFFFF00)
GUICtrlSetBkColor(-1, 0x0000FF)
$Start_Button = GUICtrlCreateButton("Start", 16, 192, 145, 33, $WS_BORDER)
GUICtrlSetFont(-1, 14, 400, 4, "Arial Black")
$Stop_Button = GUICtrlCreateButton("(Not allowed)", 280, 188, 145, 36, BitOR($BS_ICON,$WS_BORDER))
GUICtrlSetImage($Stop_Button, "092.ICO")
GUICtrlSetFont(-1, 14, 400, 4, "Arial Black")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUISetState()
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then
ExitLoop
EndIf
If $msg = $Stop_Button Then
ExitLoop
EndIf
If $msg = $Start_Button Then
$Admin = GUICtrlRead(4)
$PW = GUICtrlRead(5)
MsgBox(0, "TEST", "GUI 1: ", GUICtrlRead(4))
MsgBox(0, "TEST", "GUI 2: ", GUICtrlRead(5))
RunAsSet ($Admin, @ComputerName, $PW)
$ECODE = RunWait(@ComSpec & " /c " & "defrag /a c: > c:\DefragC.log")
If $ECODE <> 0 Then
MsgBox(4096,"Error", "Defrag Error")
; MsgBox(4096,"$ECODE = ", $ECODE)
Else
MsgBox(4096, "Result", "Defrag OK")
; MsgBox(4096,"$ECODE = ", $ECODE)
EndIf
EndIf
WEnd
RunAsSet()
Wer kann mir sagen, warum ich auf die beiden Zeilen 48 und 49 keinen Output bekomme?
Wäre für eine schnelle Antwort sehr dankbar. ![]()
Gruß
H. Weiß
Edit GtaSpider: [16.12.2007 22:06]
Spoiler Tags eingefügt
Aufruf: