#! /usr/bin/env perl use warnings; use strict; # these will be available to the Windows machines as network shares. The key # is the name as seen by the Windows machine, the value is the actual path. my %shares = ( 'home' => '/home/me', 'installs' => '/map/to/some/other/share' ); my $target = shift or die "Usage: $0 hostname\n"; my $resolution = shift; $resolution = '1680x1050' unless $resolution; # build my command my $command = "/usr/bin/rdesktop -g $resolution -P "; foreach my $share ( keys %shares ) { $command .= "-r disk:$share='$shares{$share} "; } $command .= $target; # and execute it qx/$command/;