'wrap 'wrap command filemask generates lots of commands... DEFINT a-z FUNCTION PBMAIN() x$ = TRIM$(COMMAND$) IF x$ = "" OR INSTR(x$, " ")=0 THEN PRINT "wrap command filemask" PRINT "if you need a space, use ""_"" instead" EXIT FUNCTION END IF DIM FilesFound$(1 TO 5000) Found=0 TheCommand$ = TRIM$(MID$(x$,1,INSTR(x$," ")-1)) REPLACE "_" WITH " " IN TheCommand$ Mask$ = TRIM$(MID$(x$,INSTR(x$," ")+1)) xx$ = DIR$(Mask$) DO IF xx$ = "" THEN EXIT DO Found=Found+1 FilesFound$(Found) = xx$ xx$ = DIR$ LOOP IF Found=0 THEN PRINT "No files found matching "+Mask$ EXIT FUNCTION END IF FOR r=1 TO Found STDOUT "" STDOUT TRIM$(STR$(r))+"/"+TRIM$(STR$(Found))+": " +TheCommand$ + " " + FilesFound$(r) SHELL TheCommand$ + " " + FilesFound$(r) NEXT r END FUNCTION