Pottery Posted February 10, 2010 Share 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 Link to comment Share on other sites More sharing options...
Pottery Posted February 10, 2010 Author Share 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 Link to comment Share on other sites More sharing options...
RagsRevenge Posted February 10, 2010 Share 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 Would it not have been just as quick in the first place to use _FileListToArray and _FileWriteFromArray? Link to comment Share on other sites More sharing options...
Pottery Posted February 10, 2010 Author Share 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 Link to comment Share on other sites More sharing options...
Skrip Posted February 11, 2010 Share Posted February 11, 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) 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] Link to comment Share on other sites More sharing options...
mr-es335 Posted November 27, 2023 Share 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 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