COPYRAND v 0.3b (c) 1998 Graham Mitchell - 14 Feb 98 0) TABLE OF CONTENTS 1) INTRODUCTION 2) SYNTAX 3) EXAMPLES 4) INSTALLATION 5) KNOWN BUGS 6) REGISTRATION 7) VERSION HISTORY 8) ADDITIONAL INFO 1) INTRODUCTION This handy little DOS-based utility allows you to randomly select a file from a source directory, and copy it to a destination file. While this could have many uses, I wrote it primarily to allow me to have random signatures in my Windows email program, just like I used to on my Unix shell account. 2) SYNTAX The syntax is as follows: COPYRAND [/Y] source destination where source Lists the directory and/or filespec to choose from destination Gives the directory and/or filename to copy to /Y Suppresses prompting to confirm you want to overwrite an existing destination file 3) EXAMPLES COPYRAND *.* DUP.TXT or COPYRAND . DUP.TXT Randomly selects a file from the current directory and copies it to DUP.TXT, also in the current directory. If DUP.TXT exists, you will be prompted to overwrite it. If it does not exist, it will be created. COPYRAND C:\SIGS\*.* C:\EMAILER\SIG.FIL Randomly selects a file from the directory C:\SIGS and copies it to the file SIG.FIL in the directory C:\EMAILER COPYRAND C:\WINDOWS\*.BMP C:\WINDOWS\CURRENT.BMP Randomly selects a file ending in .BMP from the directory C:\WINDOWS\ and copies it to the file CURRENT.BMP in the same directory COPYRAND MSGS\*.* MOTD.TXT or COPYRAND MSGS MOTD.TXT Randomly chooses a file from the directory MSGS, which is a subdirectory of the current directory, and copies it to MOTD.TXT, in the current directory. COPYRAND *.TXT .\NEW\ or COPYRAND *.TXT NEW Randomly chooses a file ending in .TXT from the current directory and copies it to the directory NEW, a subdirectory of the current directory. The new file will retain the original filename. Anyway, you get the idea. If for some reason you forget the syntax, just typing COPYRAND with no parameters will give you a brief command summary. 4) INSTALLATION Just copy all the files from this archive into a subdirectory. To uninstall, simply delete them (COPYRAND doesn't require or create any .INI files, registry entries, data files, etc). You might want to put COPYRAND.EXE in your path (C:\DOS or C:\WINDOWS\COMMAND). 5) KNOWN BUGS As far as I know, this program won't accidentally erase anything or cause any other weird behavior, but you can never be too sure. It only has one real known "bug" at this point: It can't create files with long filenames. Though this program works fine under Windows 95, it doesn't know anything about long filenames. This doesn't affect much, because it can still choose a random file from a directory of files with long filenames (since they have short filenames it can see, too). If your destination file already exists and has a long filename, COPYRAND Does The Right Thing if you give it the short filename instead. That is, You've got a file called CRUNCH~1 TXT 4,907 10-15-97 10:17p crunch time.txt The command COPYRAND *.* CRUNCH~1.TXT does what you'd think: it randomly selects a file and replaces "crunch time.txt" with the selected file. The long filename is not affected by the copying. However, giving it a long filename for the destination file often misbehaves. COPYRAND *.* ReallyLongFileName.txt works, creating a destination file called REALLYLO.TXT COPYRAND *.* "Really Long File Name.txt" also works, creating a file alarmingly called REALLY L.TXT COPYRAND *.* ReallyLongName.txt.org chokes, giving you a error (Unable to create destination). So the moral of the story is, use short filenames. Or at least don't send me bug reports if you don't. I don't plan to address the issue of long filenames, unless I get a lot of feedback about it and someone shows me how to "get at" the Win 95 long filenames from within DOS. 6) REGISTRATION This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License (LICENSE.TXT) for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. If you enjoy this program, I'd appreciate it if you drop me a line saying so. Please send any bug reports to me, as well. I wrote this program for my own use, and have made it available thinking that perhaps there are others who would find it useful. I do not need or expect any money from you if you use it; this is freeware in every sense of the word. However, if you really feel you should send me money, I guess that'd be okay, too. Thanks for using my program. 7) VERSION HISTORY/CHANGES 0.3b third beta release 14 Feb 98 (Valentine's Day) changes from v 0.2b to 0.3b + now correctly handles files specified using . and .. + destination can now be a directory + source can now be a directory, is the same as using dir\*.* + now detects if wildcards are used for the destination and aborts + now copyrighted under the terms of the GNU General Public License + source code now included in archive 0.2b second beta release 5 Jan 98 changes from v 0.1b to 0.2b + fixed bug where source/dest being the same would erase the file + added prompting to overwrite an existing file + made filename handling much more robust 0.1b initial beta release 1 Jan 98 (New Year's Day) 8) ADDITIONAL INFORMATION Name: CpRnd03b.zip Version: 0.3b Author: Graham Mitchell Mail: 10507 Mellow Meadows #5203, Austin TX, 78750-1234 Email: mitchell@onr.com WWW: http://www.onr.com/user/mitchell/index.html