penggilas2 Posted November 14, 2009 Share Posted November 14, 2009 Create MiniPE to Autoload Ghost32 than search Ghost in CDI create script Like this :$search = FileFindFirstFile("C:\AutoRunSource\image\ImageXP.gho") If $search = -1 Then run("D.exe")EndIfWhile 1 $file = FileFindNextFile($search) If @error Then ExitLoop Run("ghost32.exe -clone,mode=pload,src=C:\AutoRunSource\image\ImageXP.gho:1,dst=1:1 -auto -sure") ProcessWaitClose("ghost32.exe") $PID = run("peshuteject.exe /eject:C","",@SW_HIDE) ProgressOn("Reboot", "Remove CD From Driver..!!!", "0 percent") For $i = 10 to 100 step 10 sleep(1000) ProgressSet( $i, $i & " percent") Next ProgressSet(100 , "Done", "Reboot") sleep(500) ProgressOff() run("peshuteject.exe /reboot","",@SW_HIDE) ExitWEndFileClose($search)than create D.au3 only change drive C to drive D.. my Question..??How to Auto search file in All drive from drive C ~ Z..?? $search = FileFindFirstFile("C~Z:\AutoRunSource\image\ImageXP.gho")Or How to Fix my CD driver in E drive Letter..?? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 14, 2009 Moderators Share Posted November 14, 2009 penggilas2,How to Auto search file in All drive from drive C ~ Z..?? $search = FileFindFirstFile("C~Z:\AutoRunSource\image\ImageXP.gho")Use DriveGetDrive to list the available drives. Then use a recursive file search to look through them in turn. There are lots of examples on the forums if you search. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Mat Posted November 14, 2009 Share Posted November 14, 2009 (edited) Use DriveGetDrive to list the available drives. Then use a recursive file search to look through them in turn. There are lots of examples on the forums if you search. M23 I don't think he wants a recursive file search... Try this: $sPath = _FindFile ("\AutoRunSource\image\ImageXP.gho") MsgBox (0, "", $sPath) Func _FindFile ($sPath, $sSearch = "All") If StringLeft ($sPath, 1) <> "\" Then $sPath = "\" & $sPath Local $aDrives = DriveGetDrive ($sSearch) For $i = 1 to $aDrives[0] If FileExists ($aDrives[$i] & $sPath) Then Return $aDrives[$i] Next Return SetError (1, 0, "") EndFunc ; ==> _FindFileMat Edit: If you want to search Cd Drives only use:$sPath = _FindFile ("\AutoRunSource\image\ImageXP.gho", "CDROM") Edited November 14, 2009 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
GEOSoft Posted November 14, 2009 Share Posted November 14, 2009 (edited) I don't think he wants a recursive file search... Try this: $sPath = _FindFile ("\AutoRunSource\image\ImageXP.gho") MsgBox (0, "", $sPath) Func _FindFile ($sPath, $sSearch = "All") If StringLeft ($sPath, 1) <> "\" Then $sPath = "\" & $sPath Local $aDrives = DriveGetDrive ($sSearch) For $i = 1 to $aDrives[0] If FileExists ($aDrives[$i] & $sPath) Then Return $aDrives[$i] Next Return SetError (1, 0, "") EndFunc ; ==> _FindFileMat Edit: If you want to search Cd Drives only use:$sPath = _FindFile ("\AutoRunSource\image\ImageXP.gho", "CDROM") Mat I think you meant to use If StringRight($sPath, 1) <> "\" and Not StringLeft() Tip: Another method of making sure the path ends in a "\" is this $sPath = StringRegExpReplace($sPath, "(?i)^([a-z]:.*?)(?:\\)*$", "$1\\") EDIT: Slight modification to the SRE in case for some reason the original path ended in double (or more) backslashes. Edited November 14, 2009 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Mat Posted November 14, 2009 Share Posted November 14, 2009 (edited) Nope! completely deliberate.C:Documents and settings\test\test.txt is completely wrong, thats why it needs a "\" at the beginning. The end does not matter in this case. Mat incidently, For searching a drive / folder recursively, I've done this: http://www.autoitscript.com/forum/index.php?showtopic=104982 Edited November 14, 2009 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
GEOSoft Posted November 14, 2009 Share Posted November 14, 2009 Nope! completely deliberate.C:Documents and settings\test\test.txt is completely wrong, thats why it needs a "\" at the beginning. The end does not matter in this case. Mat Okay, now I see what you were doing. Morning (brain) fog made it difficult to comprehend. The SRE method for that is probably $sPath = StringRegExpReplace($sPath, "(?i)(?:\\)*(.+)$", "\\$1") George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Mat Posted November 14, 2009 Share Posted November 14, 2009 Okay, now I see what you were doing. Morning (brain) fog made it difficult to comprehend. The SRE method for that is probably $sPath = StringRegExpReplace($sPath, "(?i)(?:\\)*(.+)$", "\\$1") $hTimer = TimerInit () For $i = 1 to 100 $sPath = "documents and settings\test\test.txt" $sPath = StringRegExpReplace($sPath, "(?i)(?:\\)*(.+)$", "\\$1") Next $nTime1 = Round (TimerDiff ($hTimer) / 100, 5) $hTimer = TimerInit () For $i = 1 to 100 $sPath = "documents and settings\test\test.txt" If StringLeft ($sPath, 1) <> "\" Then $sPath = "\" & $sPath Next $nTime2 = Round (TimerDiff ($hTimer) / 100, 5) MsgBox (0, "results", "Time 1: " & $nTime1 & @CRLF & "Time 2: " & $nTime2) Although the SRE is pretty, it remains slow. Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
yashrai Posted November 14, 2009 Share Posted November 14, 2009 how to make a button\form Search word find in MS-ACCESS database table\colum Link to comment Share on other sites More sharing options...
penggilas2 Posted November 14, 2009 Author Share Posted November 14, 2009 I don't think he wants a recursive file search... Try this: $sPath = _FindFile ("\AutoRunSource\image\ImageXP.gho") MsgBox (0, "", $sPath) Func _FindFile ($sPath, $sSearch = "All") If StringLeft ($sPath, 1) <> "\" Then $sPath = "\" & $sPath Local $aDrives = DriveGetDrive ($sSearch) For $i = 1 to $aDrives[0] If FileExists ($aDrives[$i] & $sPath) Then Return $aDrives[$i] Next Return SetError (1, 0, "") EndFunc ; ==> _FindFileMat Edit: If you want to search Cd Drives only use:$sPath = _FindFile ("\AutoRunSource\image\ImageXP.gho", "CDROM") I has try U script And found file In drive F, but I don`t know how to insert drive letter in Run("ghost32.exe -clone,mode=pload,src= Drive Letter :\AutoRunSource\image\SalimCD.gho:1,dst=1:1 -auto -sure") script..?? Thank`s for All.. Link to comment Share on other sites More sharing options...
GEOSoft Posted November 15, 2009 Share Posted November 15, 2009 Run("ghost32.exe -clone,mode=pload,src=" & $sPath & "\AutoRunSource\image\SalimCD.gho:1,dst=1:1 -auto -sure") George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
trancexx Posted November 15, 2009 Share Posted November 15, 2009 A bit off topic... $hTimer = TimerInit () For $i = 1 to 100 $sPath = "documents and settings\test\test.txt" $sPath = StringRegExpReplace($sPath, "(?i)(?:\\)*(.+)$", "\\$1") Next $nTime1 = Round (TimerDiff ($hTimer) / 100, 5) $hTimer = TimerInit () For $i = 1 to 100 $sPath = "documents and settings\test\test.txt" If StringLeft ($sPath, 1) <> "\" Then $sPath = "\" & $sPath Next $nTime2 = Round (TimerDiff ($hTimer) / 100, 5) MsgBox (0, "results", "Time 1: " & $nTime1 & @CRLF & "Time 2: " & $nTime2) Although the SRE is pretty, it remains slow. Mat This is probably one of the worst speed tests I've seen be done with AutoIt. Shows a big degree of not understanding how AutoIt works. The results are almost completely wrong and shouldn't be considered as a proof of anything. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 15, 2009 Moderators Share Posted November 15, 2009 trancexx,Staying off topic, why is Mat's version so wrong? I freely admit to using very similar code on several occasions - and have seen several others do the same. How would you do a speed test in such a case? And what "big degree of not understanding how AutoIt works" is being displayed here? Some of us here are not as au fait with the inner workings of Autoit and/or Windows as others.Thanks in advance for any illumination into our stygian darkness. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Mat Posted November 15, 2009 Share Posted November 15, 2009 I'll admit it was done quickly but how bad can it be? Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
trancexx Posted November 15, 2009 Share Posted November 15, 2009 trancexx,Staying off topic, why is Mat's version so wrong? I freely admit to using very similar code on several occasions - and have seen several others do the same. How would you do a speed test in such a case? And what "big degree of not understanding how AutoIt works" is being displayed here? Some of us here are not as au fait with the inner workings of Autoit and/or Windows as others.Thanks in advance for any illumination into our stygian darkness. M23What results you get with Mat's script when you replace the order of tests? Do StringLeft() test first.There are people with better understanding of the subject than me. They could give you the answers, I can only speculate on the causes (not consequence though).I would 'heat up' the engine first, before doing the speed tests. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Mat Posted November 15, 2009 Share Posted November 15, 2009 (edited) doing it a few extra times seems to remove that (Or at least minimize it). 100 times was not enough. As for heating it up... well, you learn something new every day, but I have never seen that done before. Mat Incidently... The results the same. roughly double the time for the RegEx Edited November 15, 2009 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
GEOSoft Posted November 15, 2009 Share Posted November 15, 2009 I think transcexx is refering to the fact that anything involving files can be affected by file cache so it's probably better to run it several times. And I don't see time being a critical factor here anyway since it's only called the one time so you are talking fractions of a micro-second difference. There are several factors that can affect performance in a loop. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Mat Posted November 15, 2009 Share Posted November 15, 2009 I think transcexx is refering to the fact that anything involving files can be affected by file cache so it's probably better to run it several times. And I don't see time being a critical factor here anyway since it's only called the one time so you are talking fractions of a micro-second difference. There are several factors that can affect performance in a loop.Its not affecting files the computer thinks its still a string. AutoIt Project Listing 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