Forum Discussion

socc3rpr0's avatar
socc3rpr0
Occasional Contributor
11 years ago

Search for a file & return its path in C: drive

Hello, 



I have two computers with different OS Xp, win7 and need to  load the same .dll to send some commands. But both  have different  paths as to where the .dll is located. 



Example:



Xp : C: \Workplace\ DLLS \ load.dll

Win7: C: \username\Documents and Settings\Workplace\ DLLS \ load.dll





How do you do a search/get full path  knowing the file name i.e. load.dll without physically having to always change the full path depending on which OS I am working with?



Thanks in advance!





3 Replies

  • Philip_Baird's avatar
    Philip_Baird
    Community Expert

    Hi Ed, if the paths don't change for each operating system, one option would be to store the the respective paths in Project Variables or in an ini file then use the methods on the aqEnvironment object to determine the OS and thus which stored path to load the dll from.


     


    Regards,


    Phil Baird

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Ed,


     


    In addition to the previous replies, see this How To article - it describes the ways of how to obtain a path to the MyDocuments folder. You can try using one of them.