in reply to Write file in Windows Programs folder

"Is there is a way to get it programmatically?"

Yep, all of the important directory locations are housed within the system environment variables. In Windows, you can use the set command-line command to see them all, and once you know which one refers to what, here's how you can get at them in Perl (note that the %ENV hash is not limited to Windows):

use warnings; use strict; my $prog_files_64 = $ENV{ProgramFiles}; my $prog_files_32 = $ENV{'ProgramFiles(x86)'}; print "64-bit: $prog_files_64\n"; print "32-bit: $prog_files_32\n";

Output:

64-bit: C:\Program Files 32-bit: C:\Program Files (x86)