right idea, but missing something in the execution...

Allen has some good points, but I'll add my $0.02 as well..

Create a string to execute, and pass it to the execute function. Before you execute it, display it to the console and see if the command makes sense to you. If it doesn't, it won't make sense to Execute either! Something along the lines of:
 Code:
$Cmd = this and that...
$Cmd ?
$A = Execute($Cmd)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D