Multi Copy - TC 6

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

I looked on the web and came up with this and it works now. ;)

Code: Select all

@echo off 
for /F "tokens=2-4 delims=/- " %%A in ('date/T') do set DATE=%%A-%%B-%%C
set bkpdir=c:\win_bak\ 
set where="%bkpdir%wincmd_%date%.ini" 
xcopy "d:\Downloads\WinCmd 32 5.50\wincmd.ini" %where% /q /i /-y
I'm not quite sure if it is politically correct but it gives me a filename like this:

wincmd_11-28-2003.ini

The only problem I am still having is that it asks me if it is a file or directorty I am making when I run the batch file.

I don't understand exactly what it is they are doing here, but it's working, anyway. Thank for all of your help and getting me this far. I owe you one. ;)
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

@Coco:
I finally got it (for anyone else who is interested, also). This will copy the backups and put a date AND time in the filename. And since I am using COPY instead of XCOPY, there is no need to put the /y parameter on it because COPY will do it automatically as long as it is called from within a batch file.

Code: Select all

@echo off
for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set mmddyyyy=%%i-%%j-%%k
echo Date: %mmddyyyy%
for /F "tokens=1-2 delims=: " %%l in ('time /t') do set hhmm=%%l%%m
echo Time: %hhmm%
rem --  or use both
echo %mmddyyyy%_%hhmm%
rem --  here is the copy command with the date and time appended
Copy "d:\Downloads\WinCmd 32 5.50\wincmd.ini" "d:\Downloads\WinCmd 32 5.50\Backup\wincmd_%mmddyyyy%_%hhmm%.ini"
Copy "d:\Downloads\WinCmd 32 5.50\Wcx_ftp.ini" "d:\Downloads\WinCmd 32 5.50\Backup\Wcx_ftp_%mmddyyyy%_%hhmm%.ini"
Thanks for all of your help, sir. ;)
User avatar
Coco
Senior Member
Senior Member
Posts: 223
Joined: 2003-02-07, 13:35 UTC
Location: Belgium
Contact:

Post by *Coco »

Cool I did know about this for replacing the / by -.

In fact you don't need to use the xcopy just use a simple copy and it will also work without the last question.

@echo off
for /F "tokens=2-4 delims=/- " %%A in ('date/T') do set DATE=%%A-%%B-%%C
set bkpdir=c:\win_bak\
set where="%bkpdir%wincmd_%date%.ini"
copy "d:\Downloads\WinCmd 32 5.50\wincmd.ini" %where% -y

If you want to create more file per day you can also modify this to add the time in the name ....
Alain
User avatar
Coco
Senior Member
Senior Member
Posts: 223
Joined: 2003-02-07, 13:35 UTC
Location: Belgium
Contact:

Post by *Coco »

:lol: we were posting at the same time ...
Alain
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

LOL Great minds think alike. ;)

Now all I got to figure out is how to get this to run automatically once a day. I can do it manually for the other times if I need to.
Basiltoo
Junior Member
Junior Member
Posts: 10
Joined: 2003-11-28, 11:09 UTC
Location: Cornwall UK

Re: Multi Copy - TC 6

Post by *Basiltoo »

captjlddavis wrote:Good day to all.

If I try and select two files in the source directory:
"drafts" and "important"

I get:

Copy (2) files to

C:\temp\*.* - (I Edit to read "C:\temp\old_*.*)

And the resulting target files are:

"old_rtant" and "old_ts"

regards:cptjlddavis
If the filenames you wish to copy do not have an extension (as in your example above), how about just copy/renaming to *.old. If they do have an extension then *.*.old will also work.
Regards,
Baz
User avatar
Coco
Senior Member
Senior Member
Posts: 223
Joined: 2003-02-07, 13:35 UTC
Location: Belgium
Contact:

Post by *Coco »

Boofo wrote: Now all I got to figure out is how to get this to run automatically once a day. I can do it manually for the other times if I need to.
You have different option for this.
- Schedule it.
- Add the program at the startup. (easiest way is to put it (or a link) in the startup folder in the start menu.)
Alain
captjlddavis
Junior Member
Junior Member
Posts: 67
Joined: 2003-02-09, 23:38 UTC

Post by *captjlddavis »

Basiltoo,

Thanks very much, the "*.*.old" idea works very well. original files have no extension - but Mozilla does not seem to care.......

Boofo,

Way to go....... I think the only difference between "copy" and "xcopy" may be that "xcopy" will create the directory if it does not exist....

regards:captjlfddavis
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

But you could always do the "If not Exist, make dir" trick. ;)
captjlddavis
Junior Member
Junior Member
Posts: 67
Joined: 2003-02-09, 23:38 UTC

Post by *captjlddavis »

Boofo,

There are many variations and workarounds. To each his own.
At least we know that it works in win98se and XP.

regards:captjlddavis
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

That's the main thing, as long as it works. ;)

Thanks again for all of the help. ;)
User avatar
Black Dog
Power Member
Power Member
Posts: 1024
Joined: 2003-02-05, 22:17 UTC
Location: Odessa
Contact:

Post by *Black Dog »

[face=courier]On 28-11-2003 13:19:20 +0000 Boofo wrote:

B> Now all I got to figure out is how to get this to run
B> automatically once a day.


@ what time exactly? %)[/face]

[face=terminal]at 00:00 /i /e:M,T,W,Th,F,S,Su winbak.bat[/face]

[face=courier]P.S. Schedule service should be started.[/face]
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

Black Dog wrote:[face=courier]On 28-11-2003 13:19:20 +0000 Boofo wrote:

B> Now all I got to figure out is how to get this to run
B> automatically once a day.


@ what time exactly? %)[/face]

[face=terminal]at 00:00 /i /e:M,T,W,Th,F,S,Su winbak.bat[/face]

[face=courier]P.S. Schedule service should be started.[/face]
Is this the same thing as a svheduled task? I did that manually. How do I do it with the line you have here?
User avatar
Coco
Senior Member
Senior Member
Posts: 223
Joined: 2003-02-07, 13:35 UTC
Location: Belgium
Contact:

Post by *Coco »

Hi Boofo,

Just type the line on the command line.

If you want to have the help about the at you can type cmd (then enter) in the command line
then at the promp
at /?
Alain
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

Coco wrote:Hi Boofo,

Just type the line on the command line.

If you want to have the help about the at you can type cmd (then enter) in the command line
then at the promp
at /?
Thank you, sir. ;)
Post Reply