delorie.com/archives/browse.cgi   search  
Mail Archives: opendos/2003/10/01/00:31:48

X-Authentication-Warning: delorie.com: mail set sender to opendos-bounces using -f
Message-ID: <01FD6EC775C6D4119CDF0090273F74A4FD6B83@emwatent02.meters.com.au>
From: "da Silva, Joe" <Joe DOT daSilva AT emailmetering DOT com>
To: "'opendos AT delorie DOT com'" <opendos AT delorie DOT com>
Subject: RE: confirm before over-write
Date: Wed, 1 Oct 2003 14:31:31 +1000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Reply-To: opendos AT delorie DOT com

The following might be useful in this context. It's a batch file
I call MVN.BAT, which moves files which are "new" only, as
in files that don't exist in the destination directory. In other
words, it won't overwrite files.

You may be able to modify it to provide prompt-on-replace
capability using COPY, XCOPY or REPLACE (and call it
something appropriate, of course) ...

@echo off
REM MVN V1.11a (C) JdS 2000 [Freeware]
if $%1==$ goto help
if $%1==$/? goto help
if $%1==$/h goto help
if $%1==$/H goto help
if $%2==$ goto default1
if $%OS%==$DRDOS if not direxist %2 goto help
REM Check if destination is a root directory ...
if %2==\ goto root
for %%d in (a b c d e f g h i j k l m) do if %2==%%d:\ goto root
for %%d in (n o p q r s t u v w x y z) do if %2==%%d:\ goto root
for %%d in (A B C D E F G H I J K L M) do if %2==%%d:\ goto root
for %%d in (N O P Q R S T U V W X Y Z) do if %2==%%d:\ goto root
:dir
REM Destination is not a root directory ...
if not $%OS%==$DRDOS if not exist %2\nul goto help
if $%1==$ for %%f in (*.*) do if not exist %2\%%f move %%f %2
if not $%1==$ for %%f in (%1) do if not exist %2\%%f move %%f %2
goto end
:root
REM Destination is a root directory ...
if not $%OS%==$DRDOS if not exist %2nul goto help
if $%1==$ for %%f in (*.*) do if not exist %2%%f move %%f %2
if not $%1==$ for %%f in (%1) do if not exist %2%%f move %%f %2
goto end
:default1
REM One argument, try to re-invoke MVN with default *.* filename_mask ...
if $%0==$ MVN *.* %1
if not $%0==$ %0 *.* %1
echo Error - Unable to default "Filename_Mask" (couldn't locate MVN.BAT) ...
echo.
:help
echo MVN - Move New [Files]  (Move files not already at destination)
echo.
echo Usage :  MVN  [Filename_Mask]  Destination_Directory
echo.
:end

Joe.

> -----Original Message-----
> From:	Gary Welles [SMTP:gary AT wellesway DOT com]
> Sent:	Saturday, September 27, 2003 10:46 PM
> To:	OpenDos
> Subject:	Re: confirm before over-write
> 
> Eric Meyer, author of Video Display Editor (VDE) complained of
> these same deficiencies and wrote his own utilities.  Now
> freeware, MFD v1.2 is available at:
> 
>      http://short.stop.home.att.net/index.htm
>      http://www.geocities.com/rlcgreen/softlib1.htm
> 
> -- Gary Welles
> 
> +--------
>      The MFD (Meyer File/Directory) Utilities are a collection of six
> small,
>  efficient DOS programs that offer more powerful and convenient management
> of
>  files and directories than standard DOS commands:
> 
>      * find or operate on files by name, time/date, attributes, or size
>      * compactly display a full range of file and directory information
>      * change file or directory names, attributes, or time/date
>      * compare directory contents, showing different files and versions
>      * copy, move, back up (archive), and delete files efficiently
>      * find, create, or move levels of directories quickly
>      * easily customize default options
> 
>      What's more, to get all these features, you don't need to change or
>  replace any part of standard DOS, or load a big awkward shell.  . . .
> +---------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019