	.GOSUB INIT
	.OPENR A.
	.READ P3
	.IFT <EOF> .GOTO DONE
.NEWDIR:
	.SETS P3 P3[5:*]
	.PARSE P3 " " P3 P1
	.PARSE P2 "/" P6 P1
.; Ignore file A.;0
	.READ P1
	.IFT <EOF> .GOTO DONE
	.SETS P5 P1[1:13.]
	.IF P5 <> "A        .   " .GOTO TSTDIR
.AGAIN:
	.READ P1
	.IFT <EOF> .GOTO DONE	
	.IF P1 = "" .GOTO AGAIN
.TSTDIR:
	.SETS P5 P1[2:3]
	.IF P5 <> "**" .GOTO SCOPY
	.SETS P3 P1
	.GOTO NEWDIR
.SCOPY:
	.SETS P1 P1[1:20.]
	.IF P4 <> "G" .ASKS [1:1] P4 Copy 'P3''P1' to 'P6' [Y/N/G/Q]
	.IF P4 = "Q" .GOTO DONE
	.IF P4 = "N" .GOTO AGAIN
	.IF P4 <> "G" .AND .IF P4 <> "Y" .GOTO SCOPY
	.ENABLE QUIET
	.WAIT 'COPTSK'
	.XQT 'COPTSK' 'P2'/'SWITCH'='P3''P1'
	.DISABLE QUIET
	.IF P4 = "G" ; Copying 'P3''P1' to 'P6'
	.INC N
	.GOTO AGAIN
.DONE:	.CLOSE
	; 'N'. files copied.
	.ENABLE QUIET
	.WAIT 'COPTSK'
	PIP A.;0/DE
	.EXIT	
.INIT:	.ENABLE SUBSTITUTION
	.DISABLE LOWERCASE
	.IF P1 <> "?"  .AND .IF P1 <> "HELP" .GOTO START
	;
	; Run as
	;	>@SCOPY <filspc> <dest>
	;
	; Copies all files matching specification <filspc> to the device/directory
	; given in <dest>. The source files (<filspc>) must be on a normal RSX-11M
	; volume, i.e. "FILES-11" format. If the <dest> device is not mounted, or
	; is mounted FOREIGN, you can copy to it in RT-11 or DOS mode, and you will
	; be asked which you require.
	;
	; Any file specification valid for SRD may be used for <filspc>.
	;
	; For copies to FILES-11 devices:-
	;	Any destination/switches valid for PIP may be used for <dest>.
	;	The target device must be mounted, and you must have write
	;	access to the target directory.
	; For copies to RT-11 or DOS devices:-
	;	Destination device/switches must be valid for FLX, and mode
	;	(/IM, /FA, /FB) must be the same for both input and output files.
	;	You will be asked to specify whether RT-11 or DOS copy is required.
	;	The <dest> volume must be initialised in the required format.
	;
	.SETS P1 ""
.START:	.SETS SWITCH "FO"
	.SETS COPTSK "PIP"
	.IF P1 = "" .ASKS [::"*.*;*"] P1 Source file specification
	.IF P1 = "*" .SETS P1 "*.*"
	.IF P2 = "" .ASKS [::"SY:'<UIC>'"] P2 Destination device/directory
	.PARSE P2 ":" P3 P4
	.IF P3 = "" .GOTO NODEV
	.TESTDEVICE 'P3':
	.SETS P4 <EXSTRI>
.MTD:
	.PARSE P4 "," P5 P4
	.IF P5 = "MTD" .GOTO F11
	.IF P5 = "FOR" .GOTO FOR
	.IF P5 <> "" .GOTO MTD
.FOR:	; 'P3': is not mounted as a FILES-11 volume. Specify DOS or RT-11, or
	; give the '<CLI>' command (excluding "MOU 'P3':") to mount it.
	;
	.ASKS [::"RT-11"] P5 Volume type (RT-11 or DOS), or MOU command
	.SETS SWITCH P5[1:2]
	.IF SWITCH <> "RT" .AND .IF SWITCH <> "DO" .GOTO DOMOU
	.SETS COPTSK "FLX"
	.IF P1 = "*.*;*" .SETS P1 "*.*/SV"
	.GOTO F11
.DOMOU:	MOU 'P3':'P5'
	.IF <EXSTAT> <> 1 .GOTO FOR
	.SETS SWITCH "FO"
.F11:	.SETN N 0.
	.ENABLE QUIET
	SRD A.='P1'/-SU/-3L
	.DISABLE QUIET
	.RETURN
