Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
DOS/PDA/Other
Tag Cloud
access audio blue screen boot bsod connection crash dell desktop driver drivers dvd email error excel excel 2003 firefox hard drive hardware internet keyboard laptop malware monitor motherboard network networking outlook problem processor ram recovery router safe mode screen slow sound spyware tdlwsp.dll trojan upgrade video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > DOS/PDA/Other >
Batch File Assistance

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

 
Thread Tools
mysteryminds's Avatar
Junior Member with 5 posts.
 
Join Date: Oct 2009
25-Oct-2009, 08:57 AM #1
Batch File Assistance
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 <Main Folders> and <Sub folders>

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
Code:
@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's Avatar
Computer Specs
Distinguished Member with 5,485 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
25-Oct-2009, 10:20 AM #2
Two ways of doing this, and I don't have gimp installed to test which is better.
  1. Pass each file to gimp one at a time.
  2. Switch to each folder, then let gimp process the entire folder.
For #1 replace the For statement with this:
Code:
For /F "Tokens=1 Delims=" %%I In ('Dir /A-D /B /S %_Source%\*.jpg') Do gimp-2.6 -i -b "(batch-deskew \"%%I\")" "(gimp-quit 0)"
For #2, replace the For statement with these lines:
Code:
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.
__________________
Microsoft MVP - Windows Desktop Experience
Of course I know all the answers ; I just don't always match the answers to the right questions
Are you aware of the New Signature Limitations?
mysteryminds's Avatar
Junior Member with 5 posts.
 
Join Date: Oct 2009
25-Oct-2009, 11:08 AM #3
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
Code:
@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>
Code:
(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's Avatar
Computer Specs
Distinguished Member with 5,485 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
25-Oct-2009, 03:05 PM #4
I'm not sure of the folder structure you have.
Quote:
Originally Posted by mysteryminds View Post
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.
Quote:
Originally Posted by mysteryminds View Post
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:
Code:
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:
Code:
C:\Scripts>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

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

C:\Scripts> 
This does not do the files that are in the parent folder, D:\Scanned\folders. If that folder also contains files, use this version:
Code:
@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 "%_Source%"
gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
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:
Code:
C:\Scripts>JOB "D:\Scanned\folders"
D:\Scanned\folders> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1\Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1\Subfolder 2> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1\Subfolder 1\Sub-Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 1\Subfolder 2\Sub-Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2\Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2\Subfolder 2> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2\Subfolder 1\Sub-Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
D:\Scanned\folders\Folder 2\Subfolder 2\Sub-Subfolder 1> gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" "(gimp-quit 0)"
Press any key to continue . . .


C:\Scripts> 
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
__________________
Microsoft MVP - Windows Desktop Experience
Of course I know all the answers ; I just don't always match the answers to the right questions
Are you aware of the New Signature Limitations?
Squashman's Avatar
Distinguished Member with 14,983 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
25-Oct-2009, 06:08 PM #5
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's Avatar
Junior Member with 5 posts.
 
Join Date: Oct 2009
26-Oct-2009, 07:29 AM #6
thanks Outcaste You are the King and I bow to your wealth of Knowledge in that.

well this is the latest code I have

Code:
@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's Avatar
Computer Specs
Distinguished Member with 5,485 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
26-Oct-2009, 07:57 PM #7
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:
[code]>>"%_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
Not sure where the Terminate batch job (Y/N) prompt is coming from. The Processing title is from the Titile statement, so that sounds like the main window.
This should only appear if you've pressed CTRL+C while the batch file is running.

The Pause statements will prompt Press any key to continue... when the batch file is completed, or after displaying the Usage info. To avoid that comment out the Pause 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
Setlocal EnableDelayedExpansion
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 %_Source%
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.
gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" -b "(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 will not process any images in the parent folder (D:\Scanned\Folders)
The log output will look like this:
Code:
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
__________________
Microsoft MVP - Windows Desktop Experience
Of course I know all the answers ; I just don't always match the answers to the right questions
Are you aware of the New Signature Limitations?

Last edited by TheOutcaste : 26-Oct-2009 11:26 PM. Reason: added missing -b switch to GIMP command line
TheOutcaste's Avatar
Computer Specs
Distinguished Member with 5,485 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
26-Oct-2009, 11:25 PM #8
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:
Code:
gimp-2.6 -i -b "(batch-deskew \"*.jpg\")" -b "(gimp-quit 0)"
Without that -b I get (gimp-quit 0) can't be found messages
__________________
Microsoft MVP - Windows Desktop Experience
Of course I know all the answers ; I just don't always match the answers to the right questions
Are you aware of the New Signature Limitations?
mysteryminds's Avatar
Junior Member with 5 posts.
 
Join Date: Oct 2009
27-Oct-2009, 06:49 AM #9
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.

Code:
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's Avatar
Computer Specs
Distinguished Member with 5,485 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
03-Nov-2009, 02:44 AM #10
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:
Code:
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.

Code:
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.
__________________
Microsoft MVP - Windows Desktop Experience
Of course I know all the answers ; I just don't always match the answers to the right questions
Are you aware of the New Signature Limitations?
Squashman's Avatar
Distinguished Member with 14,983 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
03-Nov-2009, 12:26 PM #11
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.
__________________
I hate asking the same question twice!
How to ask questions the smart way!
Microsoft MVP - User Desktop Experience
Reply Bookmark and Share

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 09:59 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.