Help for this page

Select Code to Download


  1. or download this
    use strict;
    if ($^O eq "MSWin32") {
    ...
    my $dir = `$command /C dir`;
    
    print "$dir";
    
  2. or download this
    use strict;
    use File::Spec::Functions;
    ...
    my $command = canonpath('C:/Windows/System32/cmd.exe');
    my $dir = `$command /C dir`;
    print $dir;