1.

Solve : need help about archiving batch?

Answer»

i have an idea so i wanna ASK is it possible i work with scanning pictures and i archive them in server in folder skenirani and then sub folders with name of media ex: r:/clipping_skenirani/globus or r:/clipping_skenirani/vest  and there are .jpg files i want to archive in r:/bekap but not all pictures inside the media folders . ex: vest got pictures from 2 mount like 01_11_2011_vest.jpg and 01_12_2011_vest.jpg so basically i want to create batch file that will find and move to r:/bekap all the files containing mount  ex: 01_11_2011_vest.jpg but not to move the files with 01_12_2011_vest.jpg and then to zip them in bekap folder bekap.zip. i try this way but something goes wrong it don't search in sub folders

echo off
Set FindStrArgs= /R:\Clipping_Skenirani_Napisi\ ".jpg"
COPY R:\Clipping_Skenirani_Napisi\"*_11_2011_*"  R:\bekap
"C:\Program Files\7-Zip\7z.exe" a -tzip "R:\bekap\lala.zip" "R:\bekap\"
Look at xcopy.can u make this thing work or give example
echo off
Set FindStrArgs= /R:\Clipping_Skenirani_Napisi\ ".jpg"
COPY R:\Clipping_Skenirani_Napisi\BIZNIS\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\DNEVEN_FOKUS\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\DNEVEN_KAPITAL\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\DNEVNIK\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\ereporter\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\FAKTI\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\FOKUS\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\FORUM\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\forum.com.mk\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\GLOBUS\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\idividi.com.mk\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\info.com.mk\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\inpress.com.mk\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\kajgana.com.mk\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\KAPITAL\"*_01_2012_*"  R:\bekap
COPY R:\Clipping_Skenirani_Napisi\kirilica_portal\"*_01_2012_*"  R:\bekap
"C:\Program Files\7-Zip\7z.exe" a -tzip "R:\bekap\lala.zip" "R:\bekap\"

how to avoid all this subfolders COPY R:\Clipping_Skenirani_Napisi\* and how to make it to enter what string to search "*_01_2012_*" Quote from: Squashman on January 02, 2012, 07:03:49 PM

Look at xcopy.

sismis: have you tried this? xcopy /? has ALL the answers you need.i have tried xcopy but still copies all sub directories in the skenirani directory instead only the files. i will continue using my old way using start find files and folder searching the skenirani with paramters *.jpg then select all cut paste in backup and zip them
Quote from: sismis on January 04, 2012, 05:19:05 AM
i have tried xcopy but still copies all sub directories in the skenirani directory instead only the files. i will continue using my old way using start find files and folder searching the skenirani with paramters *.jpg then select all cut paste in backup and zip them

Right. My mistake. You keep doing it that way. Maybe one day you will actually read the basic help given by the /? switch and DISCOVER the /S switch, but until then let's pretend there isn't a way to do this.



ok Quote from: BC_Programmer on January 04, 2012, 05:28:36 AM
Maybe one day you will actually read the basic help given by the /? switch and discover the /S switch, but until then let's pretend there isn't a way to do this.

I wish I had thought of saying that.
Code: [Select]echo off
cd /d r:\Clipping_Skenirani_Napisi

echo Enter Search String
set /p search=?

for /r %%A in (*%search%*) do (copy %%A r:\bekap)

"C:\Program Files\7-Zip\7z.exe" a -tzip "R:\bekap\%search%lala.zip" "R:\bekap\"
It's a shame none of the built-in command-line utilities have the basic ability to copy a folder and file spec and all it's subdirectories and files. Would really be nice if we could change that ENTIRE script to far fewer LINES, if only XCOPY had a switch that could be used to indicate it should copy the files in the folder as well as recursively copy files and subdirectories in each of it's subdirectories. Oh well. I guess it's just another example of the type of low-quality software that microsoft releases. Just like how Word doesn't have basic mail-merge functionality or how Excel can't even do formulas, I tried, I put "5+5" in the formula box and it just says 5+5! That's false advertising right there. No of course I didn't read the manual.

I think the issue was that the OP didn't want any of the subdirectories in the folder being copied to, just a long list of files. Anyway, s/he has the answer they are looking for, in multiple paths of execution, so hopefully we can just call this one solved.

On another note, I can't even get Excel to recognize 1+1. It just keeps saying 1+1. Must be some really dumb people working at Microsoft to not know what 1+1 is. It keeps trying to tell me the "=" goes at the beginning. Every 1st grader knows the "=" goes at the end. Come on, that's just basic.  Quote from: Raven19528 on January 04, 2012, 12:43:46 PM
I think the issue was that the OP didn't want any of the subdirectories in the folder being copied to, just a long list of files.


Xcopy would do exactly what they needed. If used properly. And if it had the fictitious switches, such as /S.


Discussion

No Comment Found