almmatt
9 years agoContributor
Check folder path in Explorer window
I have read in the community it can be difficult to automate Windows Explorer due to different operating systems. My task is to use an operation in my application to locate a file or folder on disk using a menu option. This would open Windows Explorer to the directory where the folder or file exists. Is there a way to validate this reliably across all operating systems?
You can try this. It uses the FindChild method to look within all Sys process which will include all Explorer processes.
SUB TestSol2 DIM tst, PropNames, PropValues ' Creates arrays of property names and values PropArray = Array("Name", "Visible") ValuesArray = Array("Window('*', 'Music', 1)", "True") 'This will change with folder name we are looking for SET tst = Sys.FindChild(PropArray, ValuesArray, 10) IF tst.Exists THEN Log.Message("The folder was found open in exlporer") ELSE Log.Error("The folder was not found open in exlporer") END IF Delay(1000) END SUB