Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

copy and zip files with powershell

$
0
0

hi

I'm trying to create a PowerShell script to copy folders from one location to another and then zip them. I can do the basic copy and zip with out a problem but there is a small complication - the original folders are in a group of folders based on date and then file type and the name of the zipped file must be a combination of the folder name and the date:

Original folder: \\root\YYYY\YYYYMM\FOLDER1

(e.g \\root\2013\201301\FOLDER1, \\root\2013\201302\FOLDER1 etc)

Zipped file: \\root\zip\FOLDER1_YYYYMM.zip e.g. \\root\zip\FOLDER1_201301.zip

There are 4 years worth of files, with 12 months for each year so its a bit of a task to manually do this!

thanks for your help :)

Paul

Each of the YYYYMM folders have about a dozen different folders but I just need to zip and move 3 of them - FOLDER1, FOLDER2 and FOLDER3


Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>