Code: Select all
d := "C:\Users\" A_UserName "\Downloads"
Loop, Files, % d
msgbox % A_loopfilename
My downloads folder is filled with .txt files.
When debugged, the program goes to line 2 and then never hits line 3.
Code: Select all
d := "C:\Users\" A_UserName "\Downloads"
Loop, Files, % d
msgbox % A_loopfilename
Code: Select all
d := "C:\Users\" A_UserName "\Downloads\*.txt"
This also did the same thing as my original code. Thank you for your idea though!
Code: Select all
d := StrReplace(A_Desktop, "Desktop", "Downloads\*.txt")
Loop, Files, % d
MsgBox, %A_LoopFileName%
It actually does something else, afaics. Your original code only looks for a file called Downloads.
Code: Select all
d := StrReplace(A_Desktop, "Desktop", "Downloads")
MsgBox, 64, Directory, %d%
Loop, Files, % d "\*.txt"
MsgBox, %A_LoopFileName%
Run, %ComSpec% /k DIR "%d%"