3 posts in this topic
Hi I need your help
I need download backup from 200 remote pc. I calculate that I can download 20 backups in one time. I need to create loop, take localizations from txt file and start 20 downloads in one time (i want use ShellExecute and robocopy), after finish one from running 20 take another localizations from txt file until localizations finish. And I need trigger if is 7:00 pause script. I hope you know what I mean
Many thanks for help, sorry for my english.
This is what I got:
#include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <FileConstants.au3> #include <File.au3> #include <Array.au3> #include <Date.au3> Local $targets = @ScriptDir& "\targets.txt" Local $log_name = "\autoit.log" MsgBox($MB_SYSTEMMODAL, "", "start copy", 1) Example() Func Example() If Not FileExists($targets) Then MsgBox($MB_SYSTEMMODAL, "", "The file targets.txt - doesn't exist!") Exit EndIf FileOpen($targets, 0) Global $arr ReDim $arr[_FileCountLines($targets)+1] For $i = 1 to _FileCountLines($targets) $line = FileReadLine($targets, $i) $arr[$i] = $line ; Check if is online Local $iPing = Ping($arr[$i], 250) If $iPing Then ; ONLINE $rc = FileCopy("\\"&$arr[$i]&"\e$\backup\", @ScriptDir&"\downloads\"&$arr[$i]&"\", $FC_CREATEPATH) If $rc = 0 Then _FileWriteLog(@ScriptDir & $log_name, $arr[$i]&" ONLINE error") Else _FileWriteLog(@ScriptDir & $log_name, $arr[$i]&" ONLINE done") EndIf Else ;OFFLINE _FileWriteLog(@ScriptDir & $log_name, $arr[$i]&" OFFLINE") EndIf Next EndFunc ;==>Example MsgBox($MB_SYSTEMMODAL, "", "Finish downloads backups") Exit
Hope you're doing great.
Well, I'm writing a script that allows our Service Desk to clean several temp folder as a first diagnostic.
Indeed, the agent in charge of the issue will have to choose what to clean (web browsers temp folders, some windows one etc...)
I added a progress bar to see the current state of the script but if I select more than one checkbox, it seems that the counting is not done properly and is directly filled at 100% (when at leat 2 boxes are checked) and I don"t get the final message saying that all is done, especially for if the last box is checked.
But if I launch the process with only one checkbox checked,it's working...
I've enclosed the au3 files for you because posting them in this post would be... unreadable lol. So you can maybe do some tests as well.
I'm pretty sure the code can be optimized (a lot ) and that there is a much better way to achieve what I want the script to be.
Maybe can someone can give me a hand over here.
Thanks in advance.
TinyBackupBox : Do a Backup of folders you want to a local/external drive/directory by using Robocopy.
A Big Thank to Yashield for TVExplorer.au3 and WinApiEx.au3
Includes needed : >TVExplorer.au3 and >WinApiEx.au3
* Left Treeview :
Check all folders Checkboxes you want to backup.
Hold Shift key when clicking a first child Checkbox will check all other child Checkboxes.
A right click on a parent item will uncheck all his child Checkboxes.
* Right Treeview :
A left click for select Backup Directory.
A right click menu on an item for create a new sub-folder which you can give the name you want.
This new sub-folder will be created and added as child item of the item you have right clicked.
* Start Button :
A Click on Start Button will start backup normally.
Hold Shift key when clicking it will start backup on Idle Mode.
Idle Mode is used for start or resume backup after a period of user inactivity (that you can set by tray menu)
and will pause current backup if not idle.
* Stop Button :
A click on Stop Button will Pause backup, and any changes will affect the backup when resume it.
You can resume a current backup by Re-clicking Start Button.
Hold Shift key when clicking Stop Button will totally Cancel current backup.
In Idle mode Stop Button is inactive until you Hold Shift key and click for Cancel current backup.
* Refresh Button :
A Click will refresh both treeviews and set them to the previous selections you have done.
Hold Shift key when clicking it will refresh both treeview and set them to the root.
* Tray Menu :
By Default Robocopy copy only new files,
so i add the possibility to
_ delete previous existing dir.
_ delete destination files and dirs that no longer exists in source.
_ Preserve all Attributes.
_ Show Robocopy Console window.
_ Set Idle Time Delay.
_ Open Backup Dir.
Update of 2011-12-21
Previous downloads : 103
source and executable are available in the Download Section
minimalist but handy !
Hope you like it !
And do not forget to create backup periodically !
I am trying to add the following parameters to Robocopy embedded in an the Autoit script below: /S /COPY:DT /R:4 /LOG+:"C:Script.log"
Any suggestions how to add it?
Thanks in advance!
RunWait(@ComSpec & ' /k ' & 'robocopy.exe "' & $SR1 & '" "' & $DS1 & '" ' & $PLC, @SystemDir)
I got a bit of a problem. I need to check some checkboxes on a site, wich I can't seem to do (using _IEFormElementCheckboxSelect & _IEAction). I can't even seem to get back the value of the checkboxes. (using _IEFormElementGetValue).
Since I can't get the info I need straight from the Page Source, I use _IETagNameAllGetCollection, and then sift my way through the mess it returns!
So far I have been succesfull in finding and manipulating buttons, textarea's, some tables, and dropdown select boxes on the site. All of them using the _IEFormElementGett & Set Value function.
Through using $oElements = _IETagNameAllGetCollection($oIE), a For $oElement In $oElements / Next loop, and then checking the atrributes of $oElement, using $oElement.tagname, $oElement.id, $oElement.classname, $oElement.innertext & $oElement.Innerhtml.
Thanks to this I located on of the checkboxes them self (I think).. TAG nr 165.. This is wat it looks like when the checkbox is checked:
This is Unchecked:
Notice there is no attribute set to CHECKED, and that it's not even a UNCHECKED or something when it's unchecked on the page. It is not using "value=", so that's probably the reason the _IEFormElementGett & Set Value don't work. Also, after checking a freshly loaded page, abouy 8 TAG objects, wich seem to have something to do with that checkbox, get ID's, wich they previously didn't have.. Does anybody have any idea how I can manipulate those darn Checkboxes? How should I use the _IEFormElementCheckboxSelect on this checkbox? Is there any other way to check/uncheck a checkbox?? Many Thanks in advance!!