batch to zip and move then delete folder

January 26, 2011 at 18:57:18
Specs: Windows XP, 3ghz/3gig
question. trying to make a batch. help would be appreciated.

1. i have a text file with many folder names , this file is in c:\
2. need batch on desktop
3. batch should scan shared drive for all folders over 2 gig in size
4. if bigger zip the folder using 7zip and move to another shared drive
5. once folder is zipped and moved, delete the old folder.


See More: batch to zip and move then delete folder

Report •


#1
January 26, 2011 at 19:16:45
i dont think batch file will able to calculate the size of folder..
you will have to specify the folder names manually..or use a third party which can calculate the folder sizes and output to text.

Subhash Chandra.
www.s-chandra.co.cc


Report •

#2
January 26, 2011 at 19:17:29
i dont think batch file will able to calculate the size of folder..
you will have to specify the folder names manually..or use a third party which can calculate the folder sizes and output to text.

Love to know if batch can read folder size ,Any ideas

Subhash Chandra.
www.s-chandra.co.cc


Report •

#3
January 26, 2011 at 21:46:53
Hey Subhash,

Check out the /r switch on the for command, with the %~z syntax.

FOR /r %a IN (.) DO ECHO %~za

EDIT: Maybe the /d switch is better in this situation.

Can I put a question here?


Report •

Related Solutions

#4
January 26, 2011 at 22:03:53
UNTESTED

@ECHO OFF
SETLOCAL EnableDelayedExpansion

PUSHD "P:\a\t\h"
FOR /f "tokens=*" %%a IN ("P:\a\t\h\List.txt") DO (
FOR /d %%A IN (%%a) DO (
IF "%%~zA" GEQ "2147483648" (
ECHO 7zip Command and syntax
ECHO RD /s /q %%A
)
)
)
POPD

Can I put a question here?


Report •

#5
January 28, 2011 at 02:37:51
Thanks Matt..Thats really a good information...

Subhash Chandra.
www.s-chandra.co.cc


Report •


Ask Question