SetEnv, DirOut, C:\\Directory-Output.txt; Note: Run DOS batch file to extract the directory info RunWait, Cmd.exe /c Dir C:\\(dirname) /s /w > "%DirOut%" FileReadLine, Input,%DirOut%,4 StringMid, DirFiles,Input,0015,0006 This will read the 4th line of C:\Directory-Output.txt and variable %DirFiles% will contain the first 6 characters of the directory name.