# Batch File Assistance



## mysteryminds (Oct 25, 2009)

I have sort of same problem here and I'm new to creating batch files.

I use gimp to deskew my files in the folders.

My files are under the folder

d:\scanned\temp\<mainfolder>(e.g it will be created by the pro scanner. every user has his own user folder) 
Under every Mainfolder --> (There can be minimum of 1 subfolder and max of 10 sub folders) 
Each subfolder which ever has been created by the scanner can have minimum of 1 to anything

So my question here is how can i run a batch process under windows xp which can descrew all the images under and

There can be minimum of 300 - 1500 (main folders and related sub folders under them)

I'm very new to batch file creation and have very less knowledge to do that.

I've tried copying the batch file above and replaced dcmcjpg.exe with "gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)""

It seems not working.

My Gimp installation for windows is under Drive C:/program files/

If i execute "gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)" " as a batch file under each folder manually its done. But as a review takes ages to do that to copy and paste and delete the batch file under every folder and sub folders.

Any help is surely appreciated.

This is the actual code which I've tried

```
@Echo Off
If [%1]==[] Goto _Usage
If Not Exist "%~1" Goto _Usage2
If Not Exist %~s1\nul Goto _Usage1
Set _Source=%1
Mode CON: Cols=100 Lines=30
Title Processing %_Source% and it's subfolders
PushD "%~dp0"
For /F "Tokens=1 Delims=" %%I In ('Dir /A-D /B /S %_Source%') Do gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)" "%%I" "%%I"
PopD
Pause
Goto :EOF
:_Usage2
Echo Error: %1 does not exist.
Goto _Usage
:_Usage1
Echo Parameter Error: %1 is a file name.
Echo                : Please specify a folder name
:_Usage
Echo.
Echo %~n0 [drive:][path]foldername
Echo.
Echo.  foldername  : Name of the folder to process.
Echo.              : It must be quoted if it contains spaces and is entered
Echo.              : on the Command Line. If dropped on the batch file or it's
Echo.              : shortcut, it will be quoted automatically
Echo.
Pause
```


----------



## TheOutcaste (Aug 8, 2007)

Two ways of doing this, and I don't have gimp installed to test which is better.


Pass each file to gimp one at a time.
Switch to each folder, then let gimp process the entire folder.
For #1 replace the For statement with this:

```
For /F "Tokens=1 Delims=" %%I In ('Dir /A-D /B /S %_Source%\[COLOR=Black]*.jpg[/COLOR]') Do gimp-2.6 -i -b "(batch-deskew \"%%I\")" "(gimp-quit 0)"
```
For #2, replace the For statement with these lines:

```
For /F "Tokens=1 Delims=" %%I In ('Dir /AD /B /S %_Source%') Do (
PushD "%%I"
gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
PopD
)
```
I suspect #2 will be much faster.


----------



## mysteryminds (Oct 25, 2009)

thanks a ton "THE OUTCASTE"

I have a issue in here - Well GIMP is a super simple graphical Vector graphic program which does deskew. As I'm working for NON-PROFIT organisation we cannot afford to buy a expensive programs and surely GIMP serves our purpose for now.

right now my code is like below

```
@Echo Off
If [%1]==[] Goto _Usage
If Not Exist "%~1" Goto _Usage2
If Not Exist %~s1\nul Goto _Usage1
Set _Source=%1
Mode CON: Cols=100 Lines=30
Title Processing %_Source% and it's subfolders
PushD "%~dp0"
For /F "Tokens=1 Delims=" %%I In ('Dir /AD /B /S %_Source%') Do (
PushD "%%I"
gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
PopD
)
Pause
Goto :EOF
:_Usage2
Echo Error: %1 does not exist.
Goto _Usage
:_Usage1
Echo Parameter Error: %1 is a file name.
Echo                : Please specify a folder name
:_Usage
Echo.
Echo %~n0 [drive:][path]foldername
Echo.
Echo.  foldername  : Name of the folder to process.
Echo.              : It must be quoted if it contains spaces and is entered
Echo.              : on the Command Line. If dropped on the batch file or it's
Echo.              : shortcut, it will be quoted automatically
Echo.
Pause
```
It seems quite bizzard that it executes only the main folder but its not moving ahead.

As a test I've tried placing some 5 images under 1 sub folder1 and 3 files under sub folder 2 --> Folder 1

under folder 2 --> 
subfolder 1 --> 3 images 
subfolder 2 --> 5 images

I've executed the batch files under drive d:

Job d:\scanned\folders

The batch file dont seem to execute unless I copy the bat file under d:\scanned\folders\Folder1 (This is where I need to copy JOB.bat)

I need also the system to deskew all the FOLDER (Sub folders) without user intervention.

But as of now its stopping under every subfolder and execute it again

Could you kindly help. Also if possible is there any command line to write something of log of every main folder in any location as i can cross check the images.

If you would like to see the script under .scm <GIMP DESKEW SCRIPT>

```
(define (batch-deskew pattern)
  (let* ((filelist (cadr (file-glob pattern 1))))
    (while (not (null? filelist))
           (let*
            (
             (filename (car filelist))
             (image (car (gimp-file-load RUN-NONINTERACTIVE
                                              filename filename)))
             (drawable (car (gimp-image-get-active-layer image)))
            )
                (gimp-deskew-plugin 0 image drawable 0 0 0 0 0)
                (gimp-image-resize-to-layers image)
                (gimp-layer-flatten drawable)

              (gimp-file-save RUN-NONINTERACTIVE
                             image drawable filename filename)
              (gimp-image-delete image)
             
            )
           (set! filelist (cdr filelist))
     )
   )
)
```
Thanks in advance


----------



## TheOutcaste (Aug 8, 2007)

I'm not sure of the folder structure you have. 


mysteryminds said:


> As a test I've tried placing some 5 images under 1 sub folder1 and 3 files under sub folder 2 --> Folder 1
> 
> under folder 2 -->
> subfolder 1 --> 3 images
> subfolder 2 --> 5 images


You say 5 images under "*1 sub folder1*" but show "*subfolder 2*" --> 5 images. So are the 5 images in "*1 sub folder1*" or "*subfolder2*"?
You say 3 files under "*sub folder 2*" but show "*subfolder 1*" --> 3 images. So are the 3 images in "*sub folder 2*" or "*subfolder 1*"?
I'm not sure what the *sub folder 2* --> *Folder 1* means

I'm not sure where *Folder 1* fits in.

To process the files in a group of subfolders, you have to drag and drop the parent folder onto the batch file.
Or open a command prompt, switch to the directory that contains the batch file, then type the name of the batch file with the complete quoted path to the parent folder.


mysteryminds said:


> Job d:\scanned\folders


It looks like this is what you are doing, so I'm not sure why it's stopping after doing just one folder, unless gimp is stopping the batch file somehow.
Might need to have the batch file wait for gimp to finish. It may be trying to cue up several instances which isn't working.
Try adding *start /w* to the gimp line so the batch file will wait:
*start /w gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"*

Here's how I tested:
Save the batch file as *JOB.bat* in *C:\Scripts*.
The parent folder is *D:\Scanned\folders*
So this is the structure I created:

```
D:\Scanned\folders
+---Folder 1
¦   +---Subfolder 1
¦   ¦   +---Sub-Subfolder 1
¦   +---Subfolder 2
¦       +---Sub-Subfolder 1
+---Folder 2
¦   +---Subfolder 1
¦   ¦   +---Sub-Subfolder 1
¦   +---Subfolder 2
¦       +---Sub-Subfolder 1
```
Run the batch file by switching to the *C:\Scripts* folder and type this:
*JOB "D:\Scanned\folders"*
Or, drag the *D:\Scanned\folders* folder and drop it onto *C:\Scripts\JOB.bat*:
This will be the output (I've just echoed the gimps command, but this shows it changes folders. The prompt showing the current folder is in blue:

```
[COLOR=Blue]C:\Scripts>[/COLOR]tree "D:\Scanned\folders"
Folder PATH listing for volume XP MCE
Volume serial number is 8008-D527
D:\Scanned\folders
+---Folder 1
¦   +---Subfolder 1
¦   ¦   +---Sub-Subfolder 1
¦   +---Subfolder 2
¦       +---Sub-Subfolder 1
+---Folder 2
¦   +---Subfolder 1
¦   ¦   +---Sub-Subfolder 1
¦   +---Subfolder 2
¦       +---Sub-Subfolder 1

[COLOR=Blue]C:\Scripts>[/COLOR]JOB "D:\Scanned\folders"
[COLOR=Blue]D:\Scanned\folders\Folder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 2>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 1\Subfolder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 1\Subfolder 2>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 1\Subfolder 1\Sub-Subfolder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 1\Subfolder 2\Sub-Subfolder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 2\Subfolder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 2\Subfolder 2>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 2\Subfolder 1\Sub-Subfolder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 2\Subfolder 2\Sub-Subfolder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
Press any key to continue . . .

[COLOR=Blue]C:\Scripts>[/COLOR]
```
This does not do the files that are in the parent folder, *D:\Scanned\folders*. If that folder also contains files, use this version:

```
@Echo Off
If [%1]==[] Goto _Usage
If Not Exist "%~1" Goto _Usage2
If Not Exist %~s1\nul Goto _Usage1
Set _Source=%1
Mode CON: Cols=100 Lines=30
Title Processing %_Source% and it's subfolders
[COLOR=DarkRed]PushD "%_Source%"
gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"[/COLOR]
For /F "Tokens=1 Delims=" %%I In ('Dir /AD /B /S %_Source%') Do (
PushD "%%I"
gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
PopD
)
Pause
Goto :EOF
:_Usage2
Echo Error: %1 does not exist.
Goto _Usage
:_Usage1
Echo Parameter Error: %1 is a file name.
Echo                : Please specify a folder name
:_Usage
Echo.
Echo %~n0 [drive:][path]foldername
Echo.
Echo.  foldername  : Name of the folder to process.
Echo.              : It must be quoted if it contains spaces and is entered
Echo.              : on the Command Line. If dropped on the batch file or it's
Echo.              : shortcut, it will be quoted automatically
Echo.
Pause
```
This is the output, showing it will also process *D:\Scanned\folders*:

```
[COLOR=Blue]C:\Scripts>[/COLOR]JOB "D:\Scanned\folders"
[B][COLOR=Blue]D:\Scanned\folders>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"[/B]
[COLOR=Blue]D:\Scanned\folders\Folder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 2>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 1\Subfolder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 1\Subfolder 2>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 1\Subfolder 1\Sub-Subfolder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 1\Subfolder 2\Sub-Subfolder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 2\Subfolder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 2\Subfolder 2>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 2\Subfolder 1\Sub-Subfolder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
[COLOR=Blue]D:\Scanned\folders\Folder 2\Subfolder 2\Sub-Subfolder 1>[/COLOR] gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
Press any key to continue . . .


[COLOR=Blue]C:\Scripts>[/COLOR]
```
For logging, it depends on what you want logged, a list of all files processed, or just the folders that were processed.
Set a variable to the path and name of the log file right before or after the Set _Source= line:
*Set _LogFile=C:\My log files\GimpsDeskew.log*
Add the appropriate command right before or after the GIMP command:
You can Echo the current folder name inside the loop:
*>>"_LogFile" Echo %CD%*
If you want a list of files, you can do a Dir inside each folder:
*>>"_LogFile" Dir /A-D /B *.jpg*

Jerry


----------



## Squashman (Apr 4, 2003)

Hey mysteryminds,
Welcome to the forums. You found the right person to help you with your batch file.

But, for future reference it is common courtesy to start your own thread when you have a question regardless if you think it is the same problem.


----------



## mysteryminds (Oct 25, 2009)

thanks Outcaste You are the King and I bow to your wealth of Knowledge in that.

well this is the latest code I have


```
@Echo Off
If [%1]==[] Goto _Usage
If Not Exist "%~1" Goto _Usage2
If Not Exist %~s1\nul Goto _Usage1
Set _Source=%1
Set _LogFile=C:\My log files\GimpsDeskew.log
Mode CON: Cols=100 Lines=30
Title Processing %_Source% and it's subfolders
PushD "%~dp0"
For /F "Tokens=1 Delims=" %%I In ('Dir /AD /B /S %_Source%') Do (
PushD "%%I"
>>"_LogFile" Dir /A-D /B *.jpg*
start /w gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
>>"_LogFile" Echo %CD%*
PopD
)
Pause
Goto :EOF
:_Usage2
Echo Error: %1 does not exist.
Goto _Usage
:_Usage1
Echo Parameter Error: %1 is a file name.
Echo                : Please specify a folder name
:_Usage
Echo.
Echo %~n0 [drive:][path]foldername
Echo.
Echo.  foldername  : Name of the folder to process.
Echo.              : It must be quoted if it contains spaces and is entered
Echo.              : on the Command Line. If dropped on the batch file or it's
Echo.              : shortcut, it will be quoted automatically
Echo.
Pause
```
This is the file as of now.

List of things I'm not able to do as of now are as follows:

1. Not able to Write the Log to the location "C:\My log files\GimpsDeskew.log" even though I've created the folder My Log files and also the .log file - So what I'm looking for in the log is (The folder name "The main Folder" - Sub folders - images of subfolder)

My dialup connection is really bad so I'm not able to attach the screenshots.

still having issues on here

When i execute the batch file on the folder the operation starts perfect till end then there gets a issue - I need to literally close that DOS window (Which says "Batch command executed successfully" after that i have to close that window by clicking "X" again it displays a text <type any character to close the window>)

Can this part be automated so that i dont need to close the window

Right after that I have a background DOS prompt window "Processing" 
Here it says (Terminate batch job (Y/N) here i need to press N so the batch file will go and process for second folder.

Can this be automated. I'm sure you would tell me its possible very much.

**** Also please advise me where can i download any document related to batch file creation and complete automation. Surely i dont need to keep taking your valuable time

Thanks again and you really rock my world


----------



## TheOutcaste (Aug 8, 2007)

I've had this moved to it's own thread, as we are straying far from the OP's question.

I can't believe I made such a series of dumb errors:
Left the *%* symbols off the *_LogFile* variable name.
To output the Current Directory from inside the loop requires *!CD!* instead of *%CD%*
And that needs Delayed Expansion turned on.

The * at the end of those lines will cause a problem also.
If you copied from the notification email, it will show bold by putting * symbols before and after the bolded text; the asterisks shouldn't be included, so be sure to check the forum itself to avoid that.

The lines to output to the log file should be:


```
>>"%_LogFile%" Echo !CD!
>>"%_LogFile%" Dir /A-D /B *.jpg[code]
I would put these just before the Gimps statement.

The "Batch command executed successfully" message sounds like that's coming from GIMP. I'll have to see if I can find out how to bypass that. Guess I'll have to install GIMP:rolleyes:
Not sure where the [B]Terminate batch job (Y/N)[/B] prompt is coming from. The [B]Processing[/B] title is from the Titile statement, so that sounds like the main window.
This should only appear if you've pressed [B]CTRL+C[/B] while the batch file is running.

The [B]Pause[/B] statements will prompt [B]Press any key to continue...[/B] when the batch file is completed, or after displaying the Usage info. To avoid that comment out the [B]Pause[/B] statement just before the Usage section. I would leave the last one in though, so the usage info will be displayed if needed.
So give this a try:
[code]@Echo Off
[COLOR=DarkRed]Setlocal EnableDelayedExpansion[/COLOR]
If [%1]==[] Goto _Usage
If Not Exist "%~1" Goto _Usage2
If Not Exist %~s1\nul Goto _Usage1
Set _Source=%1
Set _LogFile=C:\My log files\GimpsDeskew.log
Mode CON: Cols=100 Lines=30
Title Processing %_Source% and it's subfolders
[COLOR=DarkRed]PushD %_Source%[/COLOR]
For /F "Tokens=1 Delims=" %%I In ('Dir /AD /B /S %_Source%') Do (
PushD "%%I"
[COLOR=DarkRed]>>"%_LogFile%" Echo !CD!
>>"%_LogFile%" Dir /A-D /B *.jpg
>>"%_LogFile%" Echo.[/COLOR]
gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" [B][COLOR=Red]-b[/COLOR][/B] "(gimp-quit 0)"
PopD
)
[COLOR=DarkRed]:: Pause[/COLOR]
Goto :EOF
:_Usage2
Echo Error: %1 does not exist.
Goto _Usage
:_Usage1
Echo Parameter Error: %1 is a file name.
Echo                : Please specify a folder name
:_Usage
Echo.
Echo %~n0 [drive:][path]foldername
Echo.
Echo.  foldername  : Name of the folder to process.
Echo.              : It must be quoted if it contains spaces and is entered
Echo.              : on the Command Line. If dropped on the batch file or it's
Echo.              : shortcut, it will be quoted automatically
Echo.
Pause
```
This will not process any images in the parent folder (*D:\Scanned\Folders*)
The log output will look like this:

```
D:\Scanned\Folders\Folder 1
Test01.jpg
TestA0.jpg

D:\Scanned\Folders\Folder 2
Test06.jpg
TestA5.jpg

D:\Scanned\Folders\Folder 1\Subfolder 1
Test02.jpg
TestA1.jpg

D:\Scanned\Folders\Folder 1\Subfolder 2
Test04.jpg
TestA3.jpg

D:\Scanned\Folders\Folder 1\Subfolder 1\Sub-Subfolder 1
Test03.jpg
TestA2.jpg

D:\Scanned\Folders\Folder 1\Subfolder 2\Sub-Subfolder 1
Test05.jpg
TestA4.jpg

D:\Scanned\Folders\Folder 2\Subfolder 1
Test07.jpg
TestA6.jpg

D:\Scanned\Folders\Folder 2\Subfolder 2
Test09.jpg
TestA8.jpg

D:\Scanned\Folders\Folder 2\Subfolder 1\Sub-Subfolder 1
Test08.jpg
TestA7.jpg

D:\Scanned\Folders\Folder 2\Subfolder 2\Sub-Subfolder 1
Test10.jpg
TestA9.jpg
```
DOS and VB Scripting Links
An A-Z Index of the Windows XP command line
Command-line reference A-Z
Using batch parameters
Windows 95/98/ME Batch file Tutorial (Still a good basic reference for WinNT/2K/XP)
Batch File Functions for NT4/2000/XP/2003
Rob van der Woude's Scripting Pages
Microsoft Script Center
Beginners Guides: WindowsXP Command Prompt
Beginners Guides: Understanding and Creating Batch Files


----------



## TheOutcaste (Aug 8, 2007)

Are you getting any errors in the GIMP Output window?
I keep getting *batch command experienced an execution error*
Or an error about a corrupt jpg. Doesn't like my sample file.
Also, there is a missing switch on the command line:

```
gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" [COLOR=Red][B]-b[/B][/COLOR] "(gimp-quit 0)"
```
Without that *-b* I get (gimp-quit 0) can't be found messages


----------



## mysteryminds (Oct 25, 2009)

Hi OUtcaste

Well after adding -b in the command line. I dont get to see any errors on the screen and also there is no log which captures that.


```
gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
```
Now I'm able to see the logs in drive c: --> one issue is solved.

The only big issue pending is "type any character to close the window" window.

Is there any option we can write in this script as we see that line we force he window to close or something like that.

But you still rock


----------



## TheOutcaste (Aug 8, 2007)

Sorry I haven't gotten back to you, haven't had much time to look at this. I haven't found anyway to close that window, I would think the gimp-quit routine would close it but it doesn't.

Couple of things to try, use start so the batch file won't wait:

```
Start "" gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" -b "(gimp-quit 0)"
```
Problem is I don't know if gimp will re-use the window, or try to open a new instance. IF you have a lot of images, that could be a problem.
You might try it using start but without the gimp-quit command, this might send the images to the same instance, and youu'll end up with just one window to close at the end.
Then, between the *)* and the *Pause* statement, put a gimp command using a small sample jpg (specify the full path to the sample) and the gimp-quit command.


```
For /F "Tokens=1 Delims=" %%I In ('Dir /AD /B /S %_Source%') Do (
PushD "%%I"
>>"%_LogFile%" Echo !CD!
>>"%_LogFile%" Dir /A-D /B *.jpg
>>"%_LogFile%" Echo.
Start "" gimp-2.6 -i -b "(batch-deskew \"*.jpg\")"
PopD
)
Start "" gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" -b "(gimp-quit 0)"
Pause
Goto :EOF
```
I haven't tested either of these, just thought I'd pass the idea along.


----------



## Squashman (Apr 4, 2003)

I believe it will opne a new Window. We use Winzip this way and it creates a new cmd window for every file it parses. But it closes that window as it completes the function. For some of our Winzip batch files we use the wait switch so that it doesn't fillup our screen with alot of Windows and kill our cpu useage to do other things.


----------

