Try enclosing $scan_pn with single quotes:

SHELL "SETW.EXE -D OUTPUT='$SCAN_PN'"

See if that helps.

Brad