Help - Search - Members - Calendar
Full Version: Windows Bat Mania
Unmanned Spaceflight.com > Mars & Missions > Past and Future > MER > Tech, General and Imagery
djellison
Most of us here probably use PTGui, img2png and so on...

well - when I have a sols full of .imgs - I put img2png in it, and a bat file containing..

del *rat*.*
md IMG
move *r1*.IMG IMG
move *r2*.IMG IMG
move *r3*.IMG IMG
move *r4*.IMG IMG
move *r5*.IMG IMG
move *r6*.IMG IMG
move *r7*.IMG IMG
move *r8*.IMG IMG
move *L8*.IMG IMG
img2png *.IMG -r

move *.IMG IMG


Sometimes I have other things in there - like moving other filetypes ( IOsomething is one ) - and sometimes I just MD a thumb folder, and move the processed ones in there afterwards (this is what I do in my huuuge HDD of archived stuff - so I have all the IMG's, and all of them as PNG's, with left in the root, right in a subfolder and thumbs in a sub folder.

I use a photoshop action that takes L257 or whatever, and reduces it to a colour frame on L5 - then I cull the other frames, leaving me with all the colour frames from that sol as PNG's

THEN - I can use autopano.exe /project:ptgui which will create a new pts file for any and all mosaics it recognises

Anyhow - anyone know a way of writing a bat or something - which will go into folder consecutively, and run those bat files? i.e. I've got folders called Sol001 to Sol270 - and I can dump the img2png and my bat file into each - but then I have to go and run it 270 times to get the results - any ideas on shortcuts for that?

Doug
M_Welander
QUOTE (djellison @ Apr 27 2005, 05:30 PM)
Anyhow - anyone know a way of writing a bat or something - which will go into folder consecutively, and run those bat files?  i.e. I've got folders called Sol001 to Sol270 - and I can dump the img2png and my bat file into each - but then I have to go and run it 270 times to get the results - any ideas on shortcuts for that?

Do you mean something along these lines?

CODE
@echo off
for /d %%t in (sol???) do %%t\f.bat
...where f.bat is the name of the batch file in the subfolders.

My apologies if I have misunderstood what you wanted to do.
djellison
Looks like it might work - could it be rewritten to copy something into each folder as well? - I'll give it a try later smile.gif



Doug
M_Welander
Yes, you can use pretty much any command you want after the do statement.
djellison
Just so I'm clear - should the ??? and %% stay as they are - or do they stand for a range of variables etc?

Doug
M_Welander
They should stay as they are. If you type the command at the command prompt rather than in a .bat file, you change the double %% to a single %, but otherwise they stay as they are.

When executed, the ??? will be matched against three arbitrary characters, and the %%t will be replaced with the matcing folders, one for each iteration.

The official Windows XP batch file specification can be found here: http://www.microsoft.com/resources/documen...n-us/batch.mspx
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.