Loop through a network folder

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
user1824
Posts: 29
Joined: 10 Sep 2021, 10:40

Loop through a network folder

20 Sep 2021, 10:15

My Network directory looks some what like below:
Network_Folder
|
|------Folder1
| |---------thisFolder-------foldr1(which further contain files)
| | |-----------------------foldr2(which further contain files)
| | |
| | |-----------------------foldrn(which further contain files)
| |
| |---------thatFolder
|
|
|------Folder2
|
|
|

So I want to iterate over "thisFolder" to get names of foldr1, foldr2, foldrn(which are folders) but I'm unable to do so.
If I go to foldr1, it picks up the file names perfectly but if to try to do the same on thisFolder to pick foldr1(folder) names, it doesn't work, it just says .DS_Store file something.
I'm using a msg box check the result.

Code: Select all

Loop Files, //180.132.20.120/Folder1/thisFolder/*.*
	MsgBox %A_LoopFileName%
Also, it just works when I add *.* at the end & I don't know what that is.
User avatar
mikeyww
Posts: 27072
Joined: 09 Sep 2014, 18:38

Re: Loop through a network folder

20 Sep 2021, 10:21

Code: Select all

dir = %A_ScriptDir% ; Change as needed
text =
Loop, Files, %dir%\*, DR
 text .= "`n" A_LoopFilePath
MsgBox, 64, Result, % text := SubStr(text, 2)
Explained: Loop, Files
user1824
Posts: 29
Joined: 10 Sep 2021, 10:40

Re: Loop through a network folder

20 Sep 2021, 10:27

Thanks @mikeyww for help!

Code: Select all

Loop Files, //adress/*, D
MsgBox %A_LoopFileName%
This worked!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: arrondark, Rohwedder and 123 guests