Computing.Net > Forums > Windows Server 2003 > Batch script to move/delete files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch script to move/delete files

Reply to Message Icon

Name: sreg73
Date: January 8, 2007 at 06:12:13 Pacific
OS: Win 2003 Server
CPU/Ram: 3.2 GHZ / 3.5 GB
Product: HP DL 380
Comment:

I am trying to write a batch script that moves all files from one network folder to another network folder. On the destination folder, I need to delete any files older than 3 days from after the move occurred. So if they files were moved on 1/8/07, they need to be deleted after 1/11/07. Here's what I have so far:

@echo on&setlocal ENABLEDELAYEDEXPANSION
echo %*|fs /c:"Database backed up:"||exit 1
move x:\*.* y:\

The move is not working with this script, and I didn't know how to acquire the date stamp for the deletion. Thanks!!



Sponsored Link
Ads by Google

Response Number 1
Name: ituk
Date: January 10, 2007 at 06:56:15 Pacific
Reply:

If you havent already try using xcopy to move and delete the files.

Open up a command prompt and type XCOPY /? for all the commands....It can also be made into a batch file simply by using notepad.

Good luck..

If it isn't broken, break it. It keeps us in a job!


0

Response Number 2
Name: manit77
Date: January 23, 2007 at 14:05:23 Pacific
Reply:

try using xxcopy.com a really great file archiving tool.


- Manit Chanthavong
http://www.acriticsreview.com


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows Server 2003 Forum Home


Sponsored links

Ads by Google


Results for: Batch script to move/delete files

write a script to delete files 7 da www.computing.net/answers/windows-2003/write-a-script-to-delete-files-7-da/8492.html

cmd command to move file www.computing.net/answers/windows-2003/cmd-command-to-move-file/8714.html

Syntax error on cmd file www.computing.net/answers/windows-2003/syntax-error-on-cmd-file/7040.html