How to retrieve information from Bash or CMD
Posted: Feb 21st, ’17, 17:08
How would one read in CMD and Bash output to then put through a regular expression and do some conditional testing on?
All-in-One Automation Software
https://www.fastkeysautomation.com/forum/
Code: Select all
RunWait %comspec% /c dir > C:\My Temp File.txt
FileRead, VarToContainContents, C:\My Temp File.txt
FileDelete, C:\My Temp File.txt
MsgBox % VarToContainContents
Code: Select all
FilePath=C:\test.jpg
objShell := ComObjCreate("WScript.Shell")
objExec := objShell.Exec(ComSpec " /c C:\Users\Username\Documents\FastKeys\exiftool.exe -XPKeywords " FilePath) ;Get the Tags/Keywords of the Image File
strStdOut := ""
while, !objExec.StdOut.AtEndOfStream
strStdOut := objExec.StdOut.ReadAll()
MsgBox %strStdOut%
return
Code: Select all
Runwait, %comspec% /c C:\Users\username\Documents\FastKeys\exiftool.exe -XPKeywords "%FilePath%" > C:\Users\Username\Documents\FastKeys\temp_tags.txt, , Hide ;Write the Image Tags/Keywords Temporarily to a File