use strict; use File::Spec::Functions; my $command = canonpath('C:/Windows/System32/cmd.exe'); my $dir = `$command /C dir`; print $dir;