Loop, Files

Get help with using AutoHotkey and its commands and hotkeys
Vh_
Posts: 201
Joined: 17 Mar 2017, 22:06

Loop, Files

06 Sep 2018, 12:08

Hi,

I'm wanting to get a full list of folder names within a folder, then loop through those and read the files within them.

To retrieve the list of folders, I tried this example with no luck:

Code: Select all

Loop, Files, C:\Users\%_UserName%\Desktop, D
{
	Msgbox, %A_LoopFileName% ;only brings back "Desktop"
}
ExitApp
How can I make this tell me each folder name that exists on the desktop?
garry
Posts: 1978
Joined: 22 Dec 2013, 12:50

Re: Loop, Files

06 Sep 2018, 12:56

show folders on desktop without subfolders

Code: Select all

Loop, Files,%a_desktop%\*.*, D
msgbox, 262208, ,%A_LoopFileName%,1
ExitApp
esc::exitapp
all folders with fullpath

Code: Select all

Loop, Files,%a_desktop%\*.*, DR
msgbox, 262208, ,%a_loopfiledir%\%A_LoopFileName%,1
ExitApp
esc::exitapp
collect to variable e

Code: Select all

Loop, Files,%a_desktop%\*.*, DR
  e .= a_loopfiledir . "\" . A_LoopFileName . "`r`n"
msgbox,%e%  
ExitApp
esc::exitapp

Return to “Ask For Help”

Who is online

Users browsing this forum: cabbagethunder, cadudesun, flyingDman, jbullock35, Lorien, Rohwedder and 228 guests