my $output= qx(H:; cd $olddirname; cd ..; move /Y $olddirname $newname); if( 0 != $? ) { die "Can't move $olddirname $newname: $output"; }