How to Read file stored in multiple location across the infra

HI All,

Could you please help me with the subjected requirement

File Name : Text1.txt on some of the servers its under c:\program files\foldername\ and on some server its in G drive \program files\folder name\

Filename and the stored location is common \program files\folder name\ but not the drive.

Naresh

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

See https://technet.microsoft.com/en-us/library/cc749104(v=ws.10).aspx for all these ENV variables.

1 Like

Hi Aram,

Thanks fort your solution its working fineā€¦