The path to the Program Files directory can be found in the registry at
HKLM\Software\Microsoft\Windows\CurrentVersion\ProgramFilesDir
The drive in which the script resides can be found using
use File::Spec::Function qw( rel2abs ); my ($drive) = rel2abs($0) =~ /^([A-Z]):/i;
Note that this won't work if the script was launched using a UNC path. ($drive will be undef.)
In reply to Re: How to have universal perl script for C and D drive ?
by ikegami
in thread How to have universal perl script for C and D drive ?
by gasho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |