in reply to dir space on remote server

You need to escape your backslashes and your dollar sign:

my $ref = `cmd.exe /c dir "\\\\swmn00xd00073\\D\$ | FIND /I "BYTES FRE +E"`; print "ref = $ref\n";

The above worked for me, as shown below:

{C} > cat script.pl #!/usr/bin/perl use strict; my $ref = `cmd.exe /c dir "\\\\192.168.78.129\\c\$" | find /i "bytes f +ree"`; print "ref = $ref\n"; {C} > script ref = 14 Dir(s) 3,949,535,232 bytes free

Replies are listed 'Best First'.
Re^2: dir space on remote server
by keith_kauai (Initiate) on Aug 24, 2009 at 19:20 UTC
    Thank you! That worked! Brilliant!