New Posts  All Forums:Forum Nav:

Batch/Shell Script

post #1 of 14
Thread Starter 
Let's keep this short.
Need a Batch or Shell Script that will make quick work of tons of pictures.

Quote:
example.jpg
example-30x30.jpg
example-300x400.jpg
I just need the original, not the thumbnails.
I really don't want to do it by hand, and my Google Fu has failed me.
Linux or Windows, it doesn't matter. I can also edit it to my needs.

Though there is one main directory, and many sub-directories. I need it to weed through both.

Thanks!
post #2 of 14
What are you trying to accomplish? Deletion, Moving, Renaming, Copying?
BlueRaven
(13 items)
 
Dead BIOS
(9 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 G74Sx NVIDIA GeForce GTX 560M  Samsung  
RAMRAMHard DriveHard Drive
Samsung  Samsung  Momentus 7200.4 Scorpio Blue 
Mouse
Logitech G700 
  hide details  
Reply
BlueRaven
(13 items)
 
Dead BIOS
(9 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 G74Sx NVIDIA GeForce GTX 560M  Samsung  
RAMRAMHard DriveHard Drive
Samsung  Samsung  Momentus 7200.4 Scorpio Blue 
Mouse
Logitech G700 
  hide details  
Reply
post #3 of 14
Thread Starter 
Quote:
Originally Posted by That Guy View Post
What are you trying to accomplish? Deletion, Moving, Renaming, Copying?
Woops. Deleting. Just want the original.
post #4 of 14
So you want to get rid of everything that isn't "example-30x30.jpg" and "example-300x400.jpg"?
BlueRaven
(13 items)
 
Dead BIOS
(9 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 G74Sx NVIDIA GeForce GTX 560M  Samsung  
RAMRAMHard DriveHard Drive
Samsung  Samsung  Momentus 7200.4 Scorpio Blue 
Mouse
Logitech G700 
  hide details  
Reply
BlueRaven
(13 items)
 
Dead BIOS
(9 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 G74Sx NVIDIA GeForce GTX 560M  Samsung  
RAMRAMHard DriveHard Drive
Samsung  Samsung  Momentus 7200.4 Scorpio Blue 
Mouse
Logitech G700 
  hide details  
Reply
post #5 of 14
Thread Starter 
Quote:
Originally Posted by That Guy View Post
So you want to get rid of everything that isn't "example-30x30.jpg" and "example-300x400.jpg"?
Well, those are the examples.
I can also edit the script to get all the right sizes.
They vary depending on the size of the original.

I'm not new to scripts, I just didn't know how to handle something like this.
post #6 of 14
Use a wildcard to define the ones you want to delete.

If the ones you delete have a "-" in them, try " del *-* " in command line and it will delete all the ones that have a "-" in the name.
BlueRaven
(13 items)
 
Dead BIOS
(9 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 G74Sx NVIDIA GeForce GTX 560M  Samsung  
RAMRAMHard DriveHard Drive
Samsung  Samsung  Momentus 7200.4 Scorpio Blue 
Mouse
Logitech G700 
  hide details  
Reply
BlueRaven
(13 items)
 
Dead BIOS
(9 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 G74Sx NVIDIA GeForce GTX 560M  Samsung  
RAMRAMHard DriveHard Drive
Samsung  Samsung  Momentus 7200.4 Scorpio Blue 
Mouse
Logitech G700 
  hide details  
Reply
post #7 of 14
Thread Starter 
Quote:
Originally Posted by That Guy View Post
Use a wildcard to define the ones you want to delete.

If the ones you delete have a "-" in them, try " del *-* " in command line and it will delete all the ones that have a "-" in the name.
What if I have some that have a date and uses "-"?
For example, 10-10-2010-60x60.jpg
A lot of the files are named differently. It's really not ideal lol
It's a ton of pictures.
post #8 of 14
Quote:
Originally Posted by mbudden View Post
What if I have some that have a date and uses "-"?
For example, 10-10-2010-60x60.jpg
A lot of the files are named differently. It's really not ideal lol
It's a ton of pictures.
Use another defining character in the name.

Example:

You want to delete "example-30x30" and not "10-10-2010-60x60.jpg"

Try using " del *-30x30* " and it will only get rid of the files with "-30x30"
BlueRaven
(13 items)
 
Dead BIOS
(9 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 G74Sx NVIDIA GeForce GTX 560M  Samsung  
RAMRAMHard DriveHard Drive
Samsung  Samsung  Momentus 7200.4 Scorpio Blue 
Mouse
Logitech G700 
  hide details  
Reply
BlueRaven
(13 items)
 
Dead BIOS
(9 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 G74Sx NVIDIA GeForce GTX 560M  Samsung  
RAMRAMHard DriveHard Drive
Samsung  Samsung  Momentus 7200.4 Scorpio Blue 
Mouse
Logitech G700 
  hide details  
Reply
post #9 of 14
Thread Starter 
Quote:
Originally Posted by That Guy View Post
Use another defining character in the name.

Example:

You want to delete "example-30x30" and not "10-10-2010-60x60.jpg"

Try using " del *-30x30* " and it will only get rid of the files with "-30x30"
Code:
del "C:\\Main\\Sub\\Sub\\*-30x30.jpg*"
It seems that worked. If I just do

Code:
del "C:\\Main\\*-30x30.jpg*"
Will that also go through the sub directories?
post #10 of 14
Quote:
Originally Posted by mbudden View Post
Code:
del "C:\\Main\\*-30x30.jpg*"
Will that also go through the sub directories?
It will not. That will just have it look in the "C:\\Main\\" directory for what to delete.

Try this

Code:
del "C:\\Main\\*\\*-30x30.jpg*"
I'm not sure if that will work though as I don't recall if wildcard directories are allowed.

Set up a test environment of directories, if you haven't already, to test that out.
BlueRaven
(13 items)
 
Dead BIOS
(9 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 G74Sx NVIDIA GeForce GTX 560M  Samsung  
RAMRAMHard DriveHard Drive
Samsung  Samsung  Momentus 7200.4 Scorpio Blue 
Mouse
Logitech G700 
  hide details  
Reply
BlueRaven
(13 items)
 
Dead BIOS
(9 items)
 
 
CPUMotherboardGraphicsRAM
Intel Core i7 G74Sx NVIDIA GeForce GTX 560M  Samsung  
RAMRAMHard DriveHard Drive
Samsung  Samsung  Momentus 7200.4 Scorpio Blue 
Mouse
Logitech G700 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming