Jump to content

Recommended Posts

Posted

Hi guys

 

i am after a script or a bat file that will copy the contents of a folder on a local server to a network share but it creates a folder with the date and copys the contents to that folder on the share

 

any ideas?

 

mark

Posted

oh do you know what i would need to add to delete the contents of the source folder after it has copied?

 

@echo off

setlocal enabledelayedexpansion

for /F "tokens=2-4 delims=/- " %%A in ('date/T') do

 

set target=c:\backup\%%A%%B%%C

xcopy "C:\test\*" "%target%\" /E /-Y

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • 157 What is your preferred operating system (PC)

    1. 1. Operating systems:


      • MacOS
      • Windows 10
      • Windows 11
      • Windows Vista
      • ChromeOS
      • Other (reply)

×
×
  • Create New...