If you were in my scripting class, I'd say "build your command string in small sections, then display it instead of running it. Does it look right? Then replace the display command with the execute command.."

Kind of like this:
 Code:
$Cmd = '"M:\fullpath\compress" '     ; base command
$Cmd = $Cmd + '"' + $Source + '" '   ; add the source argument
$Cmd = $Cmd + '"' + $Dest + '" '     ; add the dest argument
$Cmd = $Cmd + 'Flag flag FLAG'       ; add switches/flags
'About to run: ' ? $Cmd ?
; Uncomment the next line and comment the prior line after confirming the syntax
;Shell $Cmd
Note that every line where you build $Cmd ends with a space, except the last. Alternatively, each line could BEGIN with a space (except the first) - a matter of choice. By displaying this, I can see what the command will look like before I run it. I can even copy it from the screen and paste it back to test it manually.

In many of my production scripts, I define a global var called $DEBUG, and use the Msg() library (download from my web site/resources/Kix UDF Library). It contains a Dbg() function that will output the message only if $DEBUG is set. Allows me to easily enable/disable debug messages at any time.

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