GodlessSinner Posted July 3, 2009 Share Posted July 3, 2009 (edited) I want to automate shutdown after files downloading. Help me to do it. (Selecting folder, in which I download files, and periodically check each file for FileOpenError, - it's not very optimal variant..) EDIT:All what i need in this case - it's to obtain info about received data. Edited July 3, 2009 by Vitas _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
Bert Posted July 3, 2009 Share Posted July 3, 2009 can you show us what code you have tried? Have you searched the forum using the search function? Try this first. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
GodlessSinner Posted July 3, 2009 Author Share Posted July 3, 2009 (edited) Have you searched the forum using the search function?- yes, before posting. can you show us what code you have tried?-found this, but not work, I see only "Waiting for data": expandcollapse popup#RequireAdmin #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ProgressConstants.au3> GUICreate("Lod3n's Bandwidth Monitor",220,100,0,0,-1,$WS_EX_TOOLWINDOW) $label1 = GUICtrlCreateLabel ( "Waiting for data...", 10, 5,200,20) $progressbar1 = GUICtrlCreateProgress (10,20,200,20,$PBS_SMOOTH) $label2 = GUICtrlCreateLabel ( "Waiting for data...", 10, 50,200,20) $progressbar2 = GUICtrlCreateProgress (10,65,200,20,$PBS_SMOOTH) GUISetState () $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $inmax = 0 $outmax = 0 $lastin = 0 $lastout = 0 while 1 ;$colItems = $objWMIService.ExecQuery("SELECT BytesReceivedPersec,BytesSentPersec FROM Win32_PerfFormattedData_Tcpip_NetworkInterface", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) $colItems = $objWMIService.ExecQuery("SELECT BytesReceivedPersec,BytesSentPersec FROM Win32_PerfRawData_Tcpip_NetworkInterface", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $newin = $objItem.BytesReceivedPersec $newout = $objItem.BytesSentPersec ;new realtime counter code... if $lastin = 0 and $lastout = 0 Then $lastin = $newin $lastout = $newout endif $in = $newin - $lastin $out = $newout - $lastout $lastin = $newin $lastout = $newout if $in <> 0 and $out <> 0 Then if $in > $inmax then $inmax = $in if $out > $outmax then $outmax = $out $inP = int(($in / $inmax) * 100) $outP = int(($out / $outmax) * 100) ;$in = $in/1024 ;$out = $out/1024 $intext = "Bytes In/Sec: " & int($in) & " [" &$inP & "% of record]" & @CRLF $outtext = "Bytes Out/Sec: " & int($out) & " [" &$outP & "% of record]" &@CRLF GUICtrlSetData ($progressbar1,$inP) GUICtrlSetData ($label1,$intext) GUICtrlSetData ($progressbar2,$outP) GUICtrlSetData ($label2,$outtext) EndIf ExitLoop; I only care about the first network adapter, yo Next EndIf sleep(1000); bytes PER SECOND If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop WEnd I know, what is more simple way - via DllCall, but i don't know from which *.dll and which function need to call. Maybe someone know how... Edited July 3, 2009 by Vitas _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
Bert Posted July 3, 2009 Share Posted July 3, 2009 I do not have much time right now, but take a look at this:http://www.autoitscript.com/forum/index.ph...mp;#entry684646It may give you some direction The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
GodlessSinner Posted July 3, 2009 Author Share Posted July 3, 2009 Thanks, Volly, but it's not what i'm looking for. - I not use Autoit for files downloading. _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now