Why use ExpandFileName() at all? It is used for converting a relative path to an absolute path, but since the value being passed to it is already an absolute path to begin with, I would expect it to be a no-op, so just omit it:
// these are compatible with Delphi and FreePascal...
s := IncludeTrailingPathDelimiter(ExtractFileDir(Application.ExeName)) + 'subdir1\subdir2\filename.txt';
s := IncludeTrailingPathDelimiter(ExtractFileDir(ParamStr(0))) + 'subdir1\subdir2\filename.txt';
Or:
// these are also compatible with Delphi and FreePascal...
s := ExtractFilePath(Application.ExeName) + 'subdir1\subdir2\filename.txt';
s := ExtractFilePath(ParamStr(0)) + 'subdir1\subdir2\filename.txt';
Or:
// I wish Delphi had Application.Location!
s := Application.Location + 'subdir1\subdir2\filename.txt';