Hope, this helps.

code:
$sourcefile='c:\temp\test.txt'
$targetdir='\\server\share\folder\'
if not exist($targetdir)
md $targetdir
if @ERROR
? ''+@ERROR+' '+@SERROR'+' creating directory '+$targetdir
endif
endif
copy $sourcefile $targetdir
if @ERROR
? ''+@ERROR+' '+@SERROR'+' copying file '+$sourcefile+' to directory '+$targetdir
endif

_________________________
There are two types of vessels, submarines and targets.