Jump to content

wehr

Members
  • Posts

    11
  • Joined

  • Last visited

wehr's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Now i figuered it out. All i needed to do is declare my variables $AC1 and $FC1 earlier You brought me on the right track, thanks for your help.
  2. I'm sorry I had a misstake in my post as i was in a hurry. The problem when i use your exact code While $AC1 If Not ProcessExists ('FTPSync.exe') Then GUIDelete ($Form2) $AC1 = 0 EndIf WEnd is that both guis will close, but i need to keep gui1 and close the one with the progressbar only.
  3. with an $AC1 = 0 the 2nd gui (progressbar) won't show up anymore and exitloop will close my first 'while 1' --> close both guis
  4. So, by now i mastered my progressbar issues. But i came up with a new problem: When the second gui with the progressbar closes (GUIdelete) then i cant use and buttons on my first gui, but the minimise button. Here's my whole script: #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ProgressConstants.au3> #include <SendMessage.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Optik Schweiger", 283, 160, 192, 143) $Label1 = GUICtrlCreateLabel("Datenbank auswählen:", 16, 16, 249, 17) $Combo1 = GUICtrlCreateCombo("", 16, 40, 249, 25, $CBS_DROPDOWNLIST) $Combo2 = GUICtrlSetData($Combo1, "Altdorf|Feucht", "Altdorf") $Button1 = GUICtrlCreateButton("Daten auf Server übertragen", 16, 70, 249, 35, $WS_GROUP) $Button2 = GUICtrlCreateButton("OPTIMAWIN starten", 16, 115, 249, 35, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $MsgText = "Dateien werden auf den Server geladen." Global $Form2 = GUICreate("", 290, 80, -1, -1, BitOR($WS_DLGFRAME, $WS_POPUP)) Local $PBMarquee = GUICtrlCreateProgress(20, 50, 250, 15, $PBS_MARQUEE, $PBS_SMOOTH) Local $hPBMarquee = GUICtrlGetHandle($PBMarquee) _SendMessage($hPBMarquee, $PBM_SETMARQUEE, True, 20) ; final parameter is update time in ms GUICtrlCreateLabel($MsgText, 20, 20, 250, 90) GUISetState(@SW_HIDE) While 1 $nMsg = GUIGetMsg() $read = GUICtrlRead($combo1) Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If $read = "Altdorf" Then $AC1 = Run ('C:\OPTIMAWIN\sync\FTPSync AC1 /INCREMENTAL /QUIET') GUISetState(@SW_SHOW, $Form2) While $AC1 If Not ProcessExists ('FTPSync.exe') Then GUIDelete ($Form2) WEnd If $read = "Feucht" Then $FC1 = Run ('C:\OPTIMAWIN\sync\FTPSync FC1 /INCREMENTAL /QUIET') GUISetState(@SW_SHOW, $Form2) While $FC1 If Not ProcessExists ('FTPSync.exe') Then GUIDelete ($Form2) WEnd Case $Button2 If $read = "Altdorf" Then RunWait ('C:\OPTIMAWIN\sync\FTPSync AC2 /INCREMENTAL') If $read = "Feucht" Then RunWait ('C:\OPTIMAWIN\sync\FTPSync FC2 /INCREMENTAL') Run ('C:\OPTIMAWIN\OPTIMA.exe') EndSwitch WEnd
  5. I re-worked my script a little bit. Now i get a progressbar to show while my sync1.exe is running. This progressbar stays empty. I can't find anything on how to make a little dot jump from left to right, like in these windows anymations. Currently my script looks like this: Case $Button1 ProgressOn("", "test") If $read = "item1" Then $AC1 = Run ('Sync1.exe') While $AC1 Sleep ( 1000 ) ProgressSet($AC1) $AC1 = ProcessExists($AC1) Wend If $read = "item2" Then $FC1 = Run ('Sync2.exe') While $FC1 Sleep ( 1000 ) ProgressSet($FC1) $FC1 = ProcessExists($FC1) Wend ProgressOff() EDIT: sorry somehow i forgot BrewManNH's post. His script does exactly that
  6. Thanks this Progressbar works way better. Now how do i make it show while my process is running. Here's what my 'run' looks like: Case $Button1 If $read = "Altdorf" Then Run ('sync1.exe') If $read = "Feucht" Then Run ('sync2.exe') I want the progressbar to show whily 'sync1.exe' or 'sync2.exe' is running.
  7. I created a GUI. This GUI contains a Combo box. Now if u select 'item1' and click 'button1' it runs another procress then on 'item2'. As this process runs in the background i want a visual like a progress bar to make the user see that something is going. But to do this i read in another thread that the 'run(process)' command has to be in a string. For progressbar to get the process-id. i.e: ProgressOn("test", "test") $PID1 = Run("\\Server\netlogon\kix32.exe \\Server\netlogon\vpnscript.kix","", @SW_HIDE) While $PID1 Sleep ( 1000 ) ProgressSet($PID1) $PID1 = ProcessExists($PID1) Wend ProgressOff() But my Button needs an 'IF' and 'Then' i.e: Case $Button1 If $read = "item1" Then run('process1.exe') If $read = "item2" Then run('process2.exe') MsgBox(4096, "OK", "Übertragung abgeschlossen") The problem is i cant write the string behind my 'Then'. (If $read = "item1" Then $PID1) So how to combine these two correctly?
  8. I found a solution using Cyberkiko | FTPsync a GUI-less utility that does exactly what my script did, but with FTP support. Thanks if u tried helping.
  9. Hi, a few years ago i compiled a script that synchronizes 2 folders. I.e. Search both directories for new/changed/deleted files and equalizes both of them every X secs. Now i'd like to readjust this script to make is synchronize a folder on my computer and a folder on my ftp server. But so far i have no idea how to work with the ftp files. Hope u got some hints. My Script so far: $Ausgangspfad = "C:\OPTIMAWIN\daten\" ;Directory 1 $Zielpfad = "C:\OPTIMAWIN\" ;Directory 2 AdlibRegister ( "_synch", 5000) While 2 sleep (10) WEnd Func _synch() AdlibUnRegister() $search = FileFindFirstFile($Ausgangspfad&"*.*") While 1 $file = FileFindNextFile($search) If @error Then ExitLoop if StringInStr($file, ".") > 0 Then if Not FileExists ( $Zielpfad&$file) Then TrayTip("Synch","File Not Found"&@CRLF&$file, 10, 4) $File_ergebnis = Filecopy ( $Ausgangspfad&$file, $Zielpfad&$file) If $File_ergebnis = 1 Then TrayTip("Synch File Copy","OK"&@CRLF&$file, 10, 4) Else TrayTip("Synch File Copy","Error"&@CRLF&$file, 10, 2) EndIf Else if FileGetSize ($Ausgangspfad&$file) <> FileGetSize ($Zielpfad&$file) Then TrayTip("Synch","File Size Change"&@CRLF&$file, 10, 4) $File_ergebnis = Filecopy ( $Ausgangspfad&$file, $Zielpfad&$file,1) If $File_ergebnis = 1 Then TrayTip("Synch File Copy","OK"&@CRLF&$file, 10, 4) Else TrayTip("Synch File Copy","Error"&@CRLF&$file, 10, 2) EndIf Else EndIf EndIf Else if Not FileExists ( $Zielpfad&$file) Then TrayTip("Synch","Dir Not Found"&@CRLF&$file, 10, 4) $Dir_ergebnis = DirCopy ( $Ausgangspfad&$file, $Zielpfad&$file,1) If $Dir_ergebnis = 1 Then TrayTip("Synch Dir Copy","OK"&@CRLF&$file, 10, 4) Else TrayTip("Synch Dir Copy","Error"&@CRLF&$file, 10, 2) EndIf Else if DirGetSize ($Ausgangspfad&$file) <> DirGetSize ($Zielpfad&$file) Then TrayTip("Synch","Dir Size Change"&@CRLF&$file, 10, 4) $Dir_ergebnis = DirCopy ( $Ausgangspfad&$file, $Zielpfad&$file,1) If $Dir_ergebnis = 1 Then TrayTip("Synch Dir Copy","OK"&@CRLF&$file, 10, 4) Else TrayTip("Synch Dir Copy","Error"&@CRLF&$file, 10, 2) EndIf Else EndIf EndIf EndIf WEnd FileClose($search) AdlibRegister ( "_synch", 60000) EndFunc
  10. I was wondering if there is a way to make this synchonize a local directory with a folder on a server via ftp. But i can't think of any ways to insert the FTP folder correctly. Any suggestions?
  11. Hello, I'm trying to get a "splash screen" while loading a programm via a batch file. This "Splash screen" consists of a background image and and should contain the text, the .bat file echos. But my Splash closes after every message from consoleread and re-opens for the next one. Here's what my Start.bat looks like: /Xodu/xodu.exe start first | SplashScreen.exe /Xodu/xodu.exe start second | SplashScreen.exe When running these commands in the console, the console echoes: "starting binaries..." and "starting xodu..." my SplashScreen.exe (the compiled .au3) looks like this: #NoTrayIcon #include <GUIConstants.au3> #include <WindowsConstants.au3> #include<ButtonConstants.au3> #include<EditConstants.au3> #include<GUIConstantsEx.au3> #include<StaticConstants.au3> #include<WindowsConstants.au3> Local $data While True $data &= ConsoleRead ( ) If @error Then ExitLoop Sleep (1000) WEnd $tempo=4000 $tamanhox=@DesktopWidth*0.46875 $tamanhoy=$tamanhox/2 $posicaox=(@DesktopWidth/2)-($tamanhox/2) $posicaoy=(@DesktopHeight/2)-($tamanhoy) splashImageOn("","splash.gif",$tamanhox,$tamanhoy,$posicaox,$posicaoy,1) $GUI = GUICreate ("Teste", $tamanhox, $tamanhoy, $posicaox, $posicaoy,$WS_POPUP, BitOR ($WS_EX_TRANSPARENT, $WS_EX_LAYERED, $WS_EX_TOPMOST)) $label = GUICtrlCreateLabel($data, 20, $posicaoy, 250, $tamanhoy/4) GUICtrlSetFont(-1,10,$tamanhox/1000) WinSetTrans ($GUI, "", 100) GUISetBkColor(0x4169e1, $GUI) GUISetState(@SW_SHOW,$GUI) Sleep($tempo) So when i click my start.bat i see the splash screen with "starting binaries..." after about 2 secs it disapears and then after another second it reapears with the text "starting xodu...". Now how could i make it stay all the time?
×
×
  • Create New...