Removing OLD images from Pictures directory

Is there any way to automatically remove images from the pictures directory for all inactive items?

I have a bazillion images in that directory from really old inactive items that we are never going to restock....discontinued items, etc.

There is absolutely no way we can do this manually. Too much manpower.

like if inactive date was over a year ago, then delete image?

I haven't been able to find any posts about this. Surely this is a problem for others?

help?

Mickie

Reply to
Mickie
Loading thread data ...

create your list with a SQL statement like this:

select picturename from item where inactive=1 and picturename''

export the list to a text file in the picture directory, then your dos statement to delete the files would look something like this:

for /f "tokens=1 delims=" %a > Is there any way to automatically remove images from the pictures

Reply to
Matt Hurst

Matt,

You are not unlike a god.

Do you have a paypal account I can send some money to? You have no idea how much time that just saved me!

Is there a way to do the opposite? I make a list of all the ACTIVE files and delete all that are NOT on the list?

Thanks!!!!!!

Mickie

Matt Hurst wrote:

Reply to
Mickie

the list of active items with pictures would start with this sql statement:

select picturename from item where inactive=0 and picturename''

export that to pictures.txt in your folder, then your dos commands:

md temp for /f "tokens=1 delims=" %a in (pictures.txt) do move "%a" temp del *.* /q move temp\*.* . rd temp

If that works, you can rate the post as 'answer' to the questi> Matt,

Reply to
Matt Hurst

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.