use strict; use warnings; use Cwd qw(abs_path); chdir("C:\WINDOWS\PROGRAM FILES"); # <- or whatever it is in windows. my $thisdir = abs_path('.'); print "This dir is $this_dir\n";