One of the better options here would be to be able to soft-code the path based on a lookup/reference defined somewhere on the system. For instance, is the āfoldernameā under Program Files defined somewhere in the registry that you might be able to look up as part of your relevance?
Alternatively, if you know the path, but not the drive, you could do something like:
lines of files "text1.txt" of folders "Program Files\folder name" of drives
Or even:
lines of files "text1.txt" of folders ("c:\program files\foldername\";"g:\program files\folder name\")
Additionally could the environment variable %PROGRAMFILES% point to the right place on all systems? Usually the usage of a directory called āProgram Filesā is just because someone puts it on a different drive