Hi,
such mal nach z.B. _GUICtrlIpAddress_Create
ich würde StringRegExp dafür empfehlen.
Mega
P.S.: DANKE! ![]()
Hi,
such mal nach z.B. _GUICtrlIpAddress_Create
ich würde StringRegExp dafür empfehlen.
Mega
P.S.: DANKE! ![]()
Hi,
das ist eine never-ending story. Das ginge z.B. nicht mehr wenn
[autoit]$date = '01032008' ; YYYY/MM/DD
;~ $new = StringRegExpReplace($date, "(\d{2})(\d{2})(\d{4})","$3/$2/$1")
$new = StringRegExpReplace ($date, "(\d{2}).(\d{2}).(\d{2,4})", "$3/$2/$1")
MsgBox(0,"",$new)
Mega
Hi,
ist evtl. eine IP Adresse? Da gibt es eigenes Control dafür!
Mega
Noch mehr
; Define Source and Destination Directories
[/autoit] [autoit][/autoit] [autoit]$source = "c:\Downloads\Frisur"
$dest = "c:\Downloads\Frisur\Müll"
; Obtain Source and Destination Directories' sizes
[/autoit] [autoit][/autoit] [autoit]$ssize = DirGetSize($source)
$dsize = DirGetSize($dest)
; Removes "-1" return if the destination directory does not exist
[/autoit] [autoit][/autoit] [autoit]if $dsize < 0 then
$dsize = 0
Endif
; Begins the timer and XCOPY to copy files (will overwrite, remove /y switch to not overwirte)
[/autoit] [autoit][/autoit] [autoit]$tbegin = TimerInit()
Run(@ComSpec & " /c xcopy /y /e " & $source & "*.* " & $dest, "", @SW_HIDE)
; Begins Progress Bar and sets it to 0
[/autoit] [autoit][/autoit] [autoit]ProgressOn("Copying Files ...", "", "0 %")
ProgressSet(0, "Calculating transfer time...")
sleep(2000); so that erroneous times are not calculated during xcopy startup
For $percent = 0 to 100
[/autoit] [autoit][/autoit] [autoit]$copied = DirGetSize($dest) - $dsize ; calculates how much has been copied
$percent = Round(($copied/$ssize),2) * 100; percentage copied
$tdiff = TimerDiff($tbegin) ; time difference since copy began
$tmin = Round(((100/$percent) -1) * ($tdiff/60000)) ; time (in minutes) to completion
$tsec = Round(((100/$percent) -1)* ($tdiff/1000)) ; tims (in secs) to completion
; If the time remaining is less than 1 minute the progress bar will show time remaining in secs
If $tsec < 60 then
$tdisplay = "Approximately " & $tsec & " second(s) remaining"
Else
$tdisplay = "Approximately " & $tmin & " minute(s) remaining."
Endif
ProgressSet( $percent, "Percentage Copied: " & $percent & " %" & @LF _
& $tdisplay)
sleep(1000)
Next
ProgressSet(100 , "Complete", "")
sleep(1500)
ProgressOff()
;-------------------------------------------------------------------------------------
; Kopiert die Datei c:\Postfach\Benutzer.pst nach \\ntsrv05\pst_archiv\A_Benutzer\
; wenn der Benutzer auf die Schaltfläche JA klickt
#include <GUIConstants.au3>
[/autoit] [autoit][/autoit] [autoit]$oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") ; Install a custom error handler
GUICreate("Radio Box Demo", 260, 140)
GUICtrlCreateLabel("Soll die Datei kopiert werden ?", 20, 20, 250) ; first cell 50 width
; Create the controls
$button_1 = GUICtrlCreateButton("Ja", 30, 50, 80, 40)
$button_2 = GUICtrlCreateButton("Nein", 140, 50, 80, 40)
; Show the GUI
GUISetState()
; Auswahl ausführen.........
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $button_1
GUISetState(@SW_HIDE)
;MsgBox(0, "Default button clicked", "Ja" )
;$username = EnvGet("username")
copy("c:\Downloads\Systemsoftware_INSTALL\Windows Updates\WindowsXP-KB835935-SP2-DEU.exe" , "c:\WindowsXP-KB835935-SP2-DEU.exe" )
Case $msg = $button_2
Exit;MsgBox(0, "Default button clicked", "Nein" )
EndSelect
WEnd
Func copy($fromFile, $tofile)
Local $FOF_RESPOND_YES = 16
Local $FOF_SIMPLEPROGRESS = 256
$winShell = ObjCreate("shell.application")
$winShell.namespace ($tofile).CopyHere ($fromFile, $FOF_RESPOND_YES)
If @error Then MsgBox(0, "", "the previous line got an error.")
EndFunc ;==>copy
; This is my custom error handler
Func MyErrFunc()
$HexNumber = Hex($oMyError.number, ![]()
MsgBox(0, "", "We intercepted a COM Error !" & @CRLF & _
"Number is: " & $HexNumber & @CRLF & _
"Windescription is: " & $oMyError.windescription)
SetError(1) ; something to check for when this function returns
EndFunc ;==>MyErrFunc
Mega
#include <file.au3>
#include <date.au3>
#include <array.au3>
;Root folder
$sourceFolder = @ScriptDir & '\'
;Gather files into an array
$fileList = _FileListToArray($sourceFolder, "*.txt", 1)
Dim $found[1]
;Loop through array
For $X = 1 To $fileList[0]
;Retrieve creation time of file
$Date = FileGetTime($sourceFolder & "\" & $fileList[$X], 1, 0)
;Format date for use with Date UDF
$fDate = StringFormat("%s/%s/%s %s:%s:%s", $Date[0], $Date[1], $Date[2], $Date[3], $Date[4], $Date[5])
;Calculate age, remove files older than one week
If _DateDiff('d', $fDate, _NowCalc()) > 7 Then ;FileDelete($sourceFolder & "\" & $fileList[$X])
_ArrayAdd($found, $sourceFolder & $fileList[$X])
;MsgBox(1, "Files deleted:", $fileList[$X], 1)
EndIf
Next
_ArrayDisplay($found)
Local $pattern = "*.*"
Local $file
Local $handle
$handle = FileFindFirstFile("c:\Downloads\" & $pattern)
If $handle = -1 Then
MsgBox(4096, "Error", "No Files found!")
Exit
EndIf
$list=""
While 1
$file = FileFindNextFile($handle)
If @error Then ExitLoop
If $file <> "." And $file <> ".." Then
If Not StringInStr(FileGetAttrib($file), "D") Then; not a directory
$time = FileGetTime($file,0,1)
$now = @YEAR & @MON & (@MDAY-10) & @HOUR & @MIN & @SEC
if $time < $now Then
$list &= $file & @CRLF
EndIf
EndIf
EndIf
Wend
FileClose($handle)
MsgBox(0,"Files older 10 days",$list)
Mega
Hi,
habe ich nicht verstanden. Ich meinte ja auch nur, ob nun
010208
20080102
020108
01022008
usw.
Man muss halt wissen was kommt
Mega
@Pee : Das ist klar. Man muss aber schon wissen was einen erwartet, dann kann man darauf reagieren.
Valik würde sagen, wer Schrott übergibt, der bekommt auch Schrott zurück.
Woran willst du diesen Unterschied YYYY/MM/DD und YYYY/DD/MM festmachen wenn es der 2008 01 01 ist? Das MUSST du wissen, oder sicher ermittlen können.
Mega
Hi,
wieso soll das nicht reichen? Du musst ja zumindest wissen YYYY irgendwas MM irgendwas DD
$date = '01032008' ; YYYY/MM/DD
$new = StringRegExpReplace($date, "(\d{2})(\d{2})(\d{4})","$3/$2/$1")
MsgBox(0,"",$new)
Mega
Hi,
wozu das Rad neu erfinden. Es gibt bereits Audio und Sound.au3 UDFs
Einfach mal suchen.
Mega
Hi,
du brauchst doch nur die exe(den Prozess) nehmen. Deine exe wird doch nur ein TrayIcon haben, oder nicht?
Mega
$date = '01.03.2008' ; YYYY/MM/DD
$new = StringRegExpReplace($date, "(\d{2})\.(\d{2})\.(\d{4})","$3/$2/$1")
MsgBox(0,"",$new)
Mega
Hi,
du meinst $cmdLine ?
Mega
Dann weißt du aber nicht ob sie angekommen ist ![]()
Solange der User das will ja. Ansonsten schließe ich einfach das Fenster oder schieße den Prozess ab. Kommt halt drauf an, wie wichtig es ist.
Könnte z.B. den Netzwerkstecker(LAN) ziehen dann OK klicken. was dann?
usw.
![]()
Mega
wie willst du denn überprüfen, ob es jemand gelesen hat. Du kannst eine Rückmeldung geben ist angekommen, okay.
Mega
Hi,
du meinst ein lokales IM. Sowas wie Sametime oder ICQ im LAN?
Mega
Hi,
dann kannst du
a) den relativen
b) den absoluten Pfad
nutzen
Mega
Hi,
zeig mal dein Script. In Scite kannst du Trace Lines einfügen lassen.
Mega
Hi,
habe dein Problem noch nicht verstanden.
Protokollieren kannst mit z.B. _FileWriteLog
Dienste überprüfen oder Prozesse kontrollieren ist ebenfalls kein Problem.
Mega