kcd-clan Posted June 27, 2006 Posted June 27, 2006 Iv been searching for a fue hours and didnt find crap. almost out of ideas Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone()
Skruge Posted June 27, 2006 Posted June 27, 2006 Look at FileFindFirstFile and FileFindNextFile. There are also numerous UDFs for file recursion & other features. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
kcd-clan Posted June 27, 2006 Author Posted June 27, 2006 (edited) Naw not gunna work. It dont know the name of file/s. I need to find out the files in the folder. BASICLY dir command in cmd but i tryed cmd dir @scrptdir but that dont work. It dosnt know how to translate ti from cmd to the script. Edited June 27, 2006 by kcd-clan Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone()
Skruge Posted June 27, 2006 Posted June 27, 2006 Naw not gunna work.It dont know the name of file/s.I need to find out the files in the folder.FileFindFirstFile takes wildcards. Look at the example in the helpfile. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
NELyon Posted June 27, 2006 Posted June 27, 2006 This will open all the exe files in a directory.. i think Run("C:\directory_name\*.exe")
kcd-clan Posted June 27, 2006 Author Posted June 27, 2006 it needs to read all file names and then read more code in each file. Can not be executed and the program needs to do it. once it reads the code its going to have it stored in the program. Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone()
Skruge Posted June 27, 2006 Posted June 27, 2006 This will open all the exe files in a directory.. i think Run("C:directory_name*.exe")Run doesn't take wildcards, and the OP isn't trying to execute every file. it needs to read all file names and then read more code in each file. Can not be executed and the program needs to do it. once it reads the code its going to have it stored in the program.Did you figure out FileFindFirstFile? Look at FileRead / FileReadLine / _FileReadToArray to "read the code" in each file. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
NELyon Posted June 27, 2006 Posted June 27, 2006 (edited) This is not tested... i don't think it works but you can try #Include <GUIConstants.au3> GUICreate("File Reader", 500, 600) $data = GUICtrlCreateEdit("Data", 40, 300, 400, 400) $data2 = FileRead("C:\directory_name\*.*") GUIctrlsetdata($data, $data2) The co-ords will probably be messed up, i made them off the top of my head Edited June 27, 2006 by codemyster
Skruge Posted June 27, 2006 Posted June 27, 2006 This is not tested... i don't think it works but you can try#Include <GUIConstants.au3> GUICreate("File Reader", 500, 600) $data = GUICtrlCreateEdit("Data", 40, 300, 400, 400) $data2 = FileRead("C:directory_name*.*") GUIctrlsetdata($data, $data2)No, FileRead doesn't take wildcards either. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
randallc Posted June 27, 2006 Posted June 27, 2006 Hi, Just modify one of the Find File scrips in the post "recursive" in my signature. Best, Randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
NELyon Posted June 27, 2006 Posted June 27, 2006 it was worth a shot. My autoitness is a little rusty
kcd-clan Posted June 28, 2006 Author Posted June 28, 2006 All i want is a function just like cmd dir Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone()
greenmachine Posted June 28, 2006 Posted June 28, 2006 I don't see how hard it is to look in the helpfile under FileFindFirstFile (as been suggested several times). Very slightly modified version of the helpfile script gives me this: $First = FileFindFirstFile (@ScriptDir & "\*.*") If $First = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf $filestr = "" While 1 $file = FileFindNextFile($First) If @error Then ExitLoop $filestr &= $file & @CRLF WEnd MsgBox(4096, "Files:", $filestr) FileClose($First)
kcd-clan Posted June 28, 2006 Author Posted June 28, 2006 (edited) IT DOSE NOT WORK........ If some one is a programmer and knows how to make a dll to return files in dirm using cmd dir somthing like so function readDIR($DIR){ run cmd $dir= dir() return $dir } if i could use php i know how to do it with that. Im not any good with vbs so i cant do taht :/ Edited June 28, 2006 by kcd-clan Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone()
greenmachine Posted June 28, 2006 Posted June 28, 2006 What do you mean it does not work? It goes through the specified directory and lists all the files contained within. That sounds like a working piece of code to me.
bluebearr Posted June 28, 2006 Posted June 28, 2006 IT DOSE NOT WORK........Respectfully, may I suggest that if code that is given to you doesn't work that you tell us what error you received so that people can help you more effectively. The code posted required the beta version. If you have the release version, this code should work: Func readDIR($DIR) Local $filestr, $First, $file $First = FileFindFirstFile ($DIR & "\*.*") While 1 $file = FileFindNextFile($First) If @error Then ExitLoop $filestr = $filestr & @CRLF & $file WEnd FileClose($First) Return $filestr EndFunc BlueBearrOddly enough, this is what I do for fun.
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