Jump to content
Sign in to follow this  
Guest DMoney

Reading a Directory Name

Recommended Posts

Guest DMoney

I need to read a directory into a variable so i can compare a string to the first 6 characters of that directory.

anyone know how?

Share this post


Link to post
Share on other sites
EightPaws

I need to read a directory into a variable so i can compare a string to the first 6 characters of that directory.

anyone know how?

<{POST_SNAPBACK}>

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.