ByIdris Posted February 25, 2013 Share Posted February 25, 2013 autoit forumda aradım ama bulamadım yapmak istediğim hardisklerin hangisinde boş alan bulursa orada işlem yapmak istiyorum ama bir türlü kodları bulamadım yardım ederseniz çok sevinirim Yardımlarınız için şimdiden teşekkürler Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted February 25, 2013 Editor Share Posted February 25, 2013 Local $iFreeSpace = DriveSpaceFree("C:\") MsgBox(4096, "Free Space:", $iFreeSpace & " MB") Quote Link to comment Share on other sites More sharing options...
ByIdris Posted February 25, 2013 Author Share Posted February 25, 2013 iyi güzelde hardisklerin hangisinde boş alan bulursa orada işlem yapmak istiyorum Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted February 26, 2013 Editor Share Posted February 26, 2013 Local $aArray = DriveGetDrive("ALL") If @error Then MsgBox(4096, "DriveGetDrive", "It appears an error occurred.") Else For $i = 1 To $aArray[0] Local $iFreeSpace = DriveSpaceFree(StringUpper($aArray[$i]) & "\") MsgBox(4096, "Free Space:",StringUpper($aArray[$i]) & "sürücüsü boş alanı " & $iFreeSpace & " MB") Next EndIf Help dosyasında var kardeşim bakarsın arada. Quote Link to comment Share on other sites More sharing options...
ByIdris Posted February 27, 2013 Author Share Posted February 27, 2013 (edited) boş alan varmı diye okutma nasıl sadece okuycak ilk gelen harddiskte o kadar boş alan varsa orda işlem yapmak istiyorum Edited February 27, 2013 by ByIdris Quote Link to comment Share on other sites More sharing options...
asmazh Posted February 27, 2013 Share Posted February 27, 2013 (edited) Ufak bir fonksiyon yazdım. İşini görür umarım. Func IsDriveFree($Drive, $FreeMB) If StringRight($Drive, 1) <> "\" And StringRight($Drive, 1) <> ":" Then $Drive &= ":" Local $DSFree = DriveSpaceFree($Drive) If $DSFree > $FreeMB Then Return SetError(0, $DSFree, True) Return False EndFunc If IsDriveFree(@HomeDrive, 1000) Then MsgBox(0, "", "İstediğiniz kadar boş alan mevcut" & @CRLF & @extended & " MB boş alan var.") If Not IsDriveFree(@HomeDrive, 1000000) Then MsgBox(0,"Maalesef", "Çok geride kalmışsınız! Bence hemen yeni bir hard disk alın.") Edited February 27, 2013 by asmazh Quote Link to comment Share on other sites More sharing options...
ByIdris Posted February 27, 2013 Author Share Posted February 27, 2013 kodlar güzel yazmışsında belirleyeceğim boyutu nereye yazcam onuda bir söyleyiversen ben bir iki kod ekledim beceremedim Quote Link to comment Share on other sites More sharing options...
ByIdris Posted February 27, 2013 Author Share Posted February 27, 2013 tamam farkettim Quote Link to comment Share on other sites More sharing options...
ByIdris Posted March 1, 2013 Author Share Posted March 1, 2013 Func IsDriveFree($Drive, $FreeMB) If StringRight($Drive, 1) <> "\" And StringRight($Drive, 1) <> ":" Then $Drive &= ":" Local $DSFree = DriveSpaceFree($Drive) If $DSFree > $FreeMB Then Return SetError(0, $DSFree, True) Return False EndFunc If IsDriveFree("C:\",15000) Then Global $NEREYE="C:\" Global $UZERINI_YAZ=1 If Not IsDriveFree("D:\",1000000) Then Global $NEREYE="D:\" Global $UZERINI_YAZ=1 If Not IsDriveFree("E:\",1000000) Then Global $NEREYE="E:\" Global $UZERINI_YAZ=1 EndIf EndIf EndIf verdiğin kodları düzenledim ama öyle bir bölüm yoksa otomatik diğerine geçiyor mu? bunu bir soriyim dedim. Quote Link to comment Share on other sites More sharing options...
asmazh Posted March 1, 2013 Share Posted March 1, 2013 (edited) Func IsDriveFree($Drive, $FreeMB) If StringRight($Drive, 1) <> "\" And StringRight($Drive, 1) <> ":" Then $Drive &= ":" Local $DSFree = DriveSpaceFree($Drive) If $DSFree > $FreeMB Then Return SetError(0, $DSFree, True) Return False EndFunc ;==>IsDriveFree Local $Array_Drives = DriveGetDrive("FIXED"), $Drives, $FreeMB = 10000 ; - 10 GB'lık boş alan araması yapalım. If Not @error Then For $x = 1 To $Array_Drives[0] If IsDriveFree($Array_Drives[$x], $FreeMB) Then $Drives &= ">> " & ($Array_Drives[$x]) & " <<" & _ " Bu diskte tam olarak " & @extended & _ " MB boş alan mevcut." & @CRLF Next Exit MsgBox(0, "", $Drives) EndIf MsgBox(0, "", "Dostum böyle bir bilgisayar kullandığın için kendinden utanmalısın.") ; - Bu mesajı aldıysan ters giden bir şeyler var demektir. Yazdığım fonksiyon sadece belirlediğin diskte istediğin kadar boş alan var mı diye kontrol eder. Varsa dönüş değeri "True", @extended değeri olarak da toplam boş alanı döner. Eğer istediğin kadar boş alan yok ise de "False" döner. Tüm diskleri kontrol etmek için bir döngü kurmalısın. Senin için kurdum, ama sorduğun soruların cevaplarını AutoIt'in "Help" klasöründe biraz gezinerek bulabilirsin. Edited March 1, 2013 by asmazh Quote Link to comment Share on other sites More sharing options...
ByIdris Posted March 1, 2013 Author Share Posted March 1, 2013 (edited) abi yardımcı oldunda autoit help klasörüne baktım işime yarayan kodları ekledim ama olmadı msgbox sildim bir iki kod ekledim beceremedim en son yazdığın kod güzel ona bir iki kod daha eklersen sevinirim misal ilk gelen harddisk üzerinde işlem yapma kodunuda verebilirsen sevinirim Edited March 1, 2013 by ByIdris Quote Link to comment Share on other sites More sharing options...
mesale0077 Posted March 1, 2013 Share Posted March 1, 2013 Local $aArray = DriveGetDrive("FIXED") For $i = 1 To $aArray[0] $drive = StringUpper($aArray[$i]) Local $iFreeSpace = DriveSpaceFree($drive & "\") $iFreeSpacegb = $iFreeSpace / 1000 $iFreeSpacegb2 = Round ( $iFreeSpacegb ,2) MsgBox(4096, "Bilgi" , $drive&" Boşluk miktarı : "& $iFreeSpacegb2 & " GB") Next gerisi sana kalmış Quote Link to comment Share on other sites More sharing options...
ByIdris Posted March 3, 2013 Author Share Posted March 3, 2013 saolun çok işime yaradı autoit çok güzel programmış biraz araştırdım harikalar ötesi Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.