"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)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.