FastFrank Posted January 30, 2006 Share Posted January 30, 2006 Hi guys, Newbie here, I just found out about Autoit and I'm really excited to see how much easier this will make my life. I'd like to know how I can locate a file on the computer where the script is running. Basically there is a file named xyz.dat on the computer and I need to copy the file abc.dat right in the same folder. So basically I want to find out the path to xyz.dat. I didn't see any Filefind function or anything. Can anyone help? Thanks Frank Link to comment Share on other sites More sharing options...
flaxcrack Posted January 30, 2006 Share Posted January 30, 2006 Hi guys, Newbie here, I just found out about Autoit and I'm really excited to see how much easier this will make my life. I'd like to know how I can locate a file on the computer where the script is running. Basically there is a file named xyz.dat on the computer and I need to copy the file abc.dat right in the same folder. So basically I want to find out the path to xyz.dat. I didn't see any Filefind function or anything.Can anyone help?ThanksFrankFrank,Crack open the help file and look up FileFindFirstFile and FileMove Good luck! [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() Link to comment Share on other sites More sharing options...
FastFrank Posted January 30, 2006 Author Share Posted January 30, 2006 Yeah I saw those functions, i wasn,t sure what they were doing exactly. The help file is kinda slim on these two. I guess I'll try to use them and see what comes up. But if anyone as a user-made function that's more newbie friendly I'd like to see it. thanks Link to comment Share on other sites More sharing options...
ChrisL Posted January 30, 2006 Share Posted January 30, 2006 (edited) This would probably do it or you could modify it to do it, you'll need the beta version of AutoIT Search ("C:") Func Search($current) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file) < 1 Then ExitLoop If Not StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then If $file = "xyz.dat" then MsgBox (0,"Path to file is ", $current & "\") EndIf If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then Search($current & "\" & $file) EndIf WEnd FileClose($search) EndFunc Edited January 30, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire 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