' Copy Files ' This script copies all the files of the selected type from one ' folder to another and will create the target folder if it does not ' already exist. The target folder name should start with a drive letter ' and can include one or more sub-folders re: d:\images\funny. ' Note: This script requires QFX 8.01 or better. If you have QFX 8.0, ' you can download the latest version of QFX free from our web site ' at http://www.qfx.com ' Important: This script is for Windows 95/98/Me. If you are ' running Windows NT/2000/XP, place a comment mark (') in front of ' the first line below and remove the comment mark from the ' second line below. $Cmd = 'command.com' ' $Cmd = 'cmd.exe' ' Set these variables to the default values to appear in the form dialog $SFolder = '' $TFolder = '' $Extn = 'JPG' $Newer = 0 GetInput: [FORM] Title="Copy Files" Size=150,40 Posn=-1,-1 Help="" [INPUTMSG] Message="Enter the name of folder with the files to be copied." Size=150,10 Posn=-1,-1 [INPUTBROWSE] Name="SFolder" Value="$SFolder" Prompt="Source Folder" Size=100,10 Posn=-1,-1 Type=Folders Extn="All Files (*.*)%*.*%" [INPUTMSG] Message="Select the file extension of the files to be copied." Size=150,10 Posn=-1,-1 [INPUTLIST] Name="Extn" List="BMP,GIF,JPG,TIF" Value="$Extn" Prompt="File Type" Size=30,60 Posn=-1,-1 Style=DropDown [INPUTMSG] Message="Enter the name of folder where you want the files from the Source Folder copied. The folder name should start with a drive letter and can include sub-folders. If the folder does not exist, it will be created." Size=150,45 Posn=-1,-1 [INPUTBROWSE] Name="TFolder" Value="$TFolder" Prompt="Target Folder" Size=100,10 Posn=-1,-1 Type=Folders Extn="All Files (*.*)%*.*%" [INPUTCHECK] Name="Newer" Value="$Newer" Prompt="Copy newer files only" Posn=-1,-1 [FORMEND] ' Make sure the folder names are not blank [IF] Len( '$SFolder' ) = 0 [MSGBOX] Name="" Prompt="You did not enter a Source Folder name. Please try again." Title="Copy Files" Buttons=Ok Icon=Exclamation [GOTO] GetInput [ENDIF] [IF] Len( '$TFolder' ) = 0 [MSGBOX] Name="" Prompt="You did not enter a Target Folder name. Please try again." Title="Copy Files" Buttons=Ok Icon=Exclamation [GOTO] GetInput [ENDIF] [IF] $Newer $NF = '/d' [ELSE] $NF = '' [ENDIF] ' Create the target folder if it does not exist ' The 'W' flag signals to supsend the script until the command completes ExecUser Prog="$Cmd /c md $TFolder" Args="" Path="" Flags="W" ' Call the 'xcopy' command to do the copy ExecUser Prog="$Cmd /c xcopy $NF $SFolder*.$Extn $TFolder" Args="" Path="" Flags="" [QUIT]