1.

Solve : DOS Command to Move Image Files to another Folder ??

Answer»

I have numerous image files (JPG/PNG format) stored in a folder. I would like to filter out (move to another folder) images that does NOT contain any of the following TEXT :

_thumb ; _tiny ; _zoom ; _std

Example: image_thumb.jpg ; image_tiny.jpg ; image_zoom.jpg ; image_std.jpg ; image.jpg

Output: image.jpg should be moved to another Folder

Anyone CARE to share DOS Command prompt to achieve this ?   

Thanks in Advance.This QUESTION also posted on DosTip.com
http://www.dostips.com/forum/viewtopic.php?f=3&t=6598Sorry about, i am desperate to get an answer pretty soon.  Untested:

Code: [Select]echo off
dir /b /a-d | findstr /v /i "_thumb _tiny _zoom _std" >file.txt
md "Another folder"
for /f "usebackq delims=" %%a in ("file.txt") do move "%%a" "Another folder"
del file.txt
Quote from: mave27 on August 11, 2015, 07:32:39 AM

Sorry about, i am desperate to get an answer pretty soon. 

Homework due in today ? ? Quote from: foxidrive on August 11, 2015, 08:09:19 AM
Untested:

Code: [Select]echo off
dir /b /a-d | findstr /v /i "_thumb _tiny _zoom _std" >file.txt
md "Another folder"
for /f "usebackq delims=" %%a in ("file.txt") do move "%%a" "Another folder"
del file.txt

Thanks  - what part of the code addresses the SOURCE location of the images ?

And - what is the syntax path for "Another folder" ?   Eg: C:\Temp\Folder\ ?? Quote from: patio on August 11, 2015, 08:13:57 AM
Homework due in today ? ?

Actually, it's a e-Comm Project i'm working on. If your images are in C:\images, you just put the BATCH file into that folder and execute it.
It will create a sub folder called "C:\images\Another Folder" and put all the images in there.
Change as needed. Quote from: Squashman on August 11, 2015, 09:03:10 AM
If your images are in C:\images, you just put the batch file into that folder and execute it.
It will create a sub folder called "C:\images\Another Folder" and put all the images in there.
Change as needed.

OK - I put the images in a folder called 'image' & placed the folder on c:/ drive. I then opened c prompt & typed the command.  Getting error: Access is denied ?!

Am I doin' something wrong ?Squashman - what exactly do you mean by <>?

How is different is it from typing out the command from MSDOS prompt ?You can execute a batch file one of two ways.
1) Double click on it with your mouse.
2) Open up a cmd prompt and navigate to the folder with the batch file and type the batch file name and hit enter.

If you are getting errors when executing the batch file then copy and paste everything from the cmd window into a post here.Thanks - working !!

Squashman - thanks for being patient.


Discussion

No Comment Found