Pottery Posted February 10, 2010 Posted February 10, 2010 (edited) Hey, I made this for a family member because he has a list of movies and wanted to make a text file contraining all of the movie names so I thought I'd share this; it could be useful I suppose Bath version: $path = IniRead("settings.ini", "path", "folder path", "default") If $Path = "default" Then MsgBox(64, "Error", "Error - setup your folder path in settings.ini!") ShellExecute("settings.ini", "", "", "edit") Exit EndIf Run("cmd.exe") Sleep(200) Send("cd " & $path & "{enter}") Sleep(100) Send("dir > list.txt" & "{enter}") Sleep(100) ProcessClose("cmd.exe") Sleep(200) ShellExecute("list.txt", "", $path, "edit") AutoIt3 functions version: #include <File.au3> $myList = _FileListToArray(@MyDocumentsDir) _FileCreate(@DesktopDir & "\List.txt") _FileWriteFromArray(@DesktopDir & "\List.txt", $myList) It's not much, but I find it useful. Thanks, Exhalt. *EDIT* Added AutoIt3 function version.DirectoryToText.rar Edited February 10, 2010 by Exhalt
Pottery Posted February 10, 2010 Author Posted February 10, 2010 By the way, I know there are AutoIt functions to do this but I just did this quick for someone; I'll post one using AutoIt functions tomorrow
RagsRevenge Posted February 10, 2010 Posted February 10, 2010 On 2/10/2010 at 4:59 AM, 'Exhalt said: By the way, I know there are AutoIt functions to do this but I just did this quick for someone; I'll post one using AutoIt functions tomorrow Would it not have been just as quick in the first place to use _FileListToArray and _FileWriteFromArray?
Pottery Posted February 10, 2010 Author Posted February 10, 2010 As I said, I would post this today. I made it quick without thinking about it for someone; here's the script. #include <File.au3> $myList = _FileListToArray(@MyDocumentsDir) _FileCreate(@DesktopDir & "\List.txt") _FileWriteFromArray(@DesktopDir & "\List.txt", $myList) mr-es335 1
Skrip Posted February 11, 2010 Posted February 11, 2010 On 2/10/2010 at 10:44 PM, 'Exhalt said: As I said, I would post this today. I made it quick without thinking about it for someone; here's the script. #include <File.au3> $myList = _FileListToArray(@MyDocumentsDir) _FileCreate(@DesktopDir & "\List.txt") _FileWriteFromArray(@DesktopDir & "\List.txt", $myList) Uhh...what? [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]
mr-es335 Posted November 27, 2023 Posted November 27, 2023 (edited) Good day, Maybe...a bit of an update...I simply required the ability to enter the specified data path... ;----------------------------------------------- #include <File.au3> ; ----------------------------------------------- GetDatapath() ;----------------------------------------------- Func GetDatapath() ; Declare the variables Local $MyPath = '' Local $MyList = '' ;---------------- ; Obtain path from user input $MyPath = InputBox("NOTICE!", "Enter the complete file path...", "", "", 150, 50) ;----------------------------------------------- ; Assign $MyPath to $MyList and create the array $MyList = _FileListToArray($MyPath) ; Create the data file _FileCreate($MyPath & "\FileListing.txt") ; Write the array to the data file _FileWriteFromArray($MyPath & "\FileListing.txt", $MyList) EndFunc ;==>GetDatapath ;----------------------------------------------- Thanks for this, Pottery...very much appreciated! Edited November 27, 2023 by mr-es335 mr-es335 Sentinel Music Studios
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