MSFN Forum: How to finis batch script? - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to finis batch script? Rate Topic: -----

#1 User is offline   flatronnn 

  • Group: Members
  • Posts: 1
  • Joined: 07-February 12
  • OS:none specified
  • Country: Country Flag

Posted 07 February 2012 - 09:39 PM

Regards to everyone.

I have the following folder structure: Folder "TEST" and inside that folder three subfolders "import", "export" and "acitve"

In folder "import" are images I've downloaded from the Internet and sort in separated folder. Example - folder "Dogs" have 8 picture....."Cats" have 4 picture and so on. Every folder have diferent number of pictures. Numbers of folder in "import" is always changing.

So far I have managed the following:

1. I resize all folders in "import" to 01,02,03.....X ...to know the order in which I work.

2. Copy EMPTY folder structure without files from "import" to folder "export". I use command:
xcopy /T /E /Q /Y "C:\TEST\import" "C:\TEST\export" ...and it works

3. If folder "01" exist in folder "import", copy all files inside folder "01" to folder "active". I use command:
IF EXIST "C:\TEST\import\01" xcopy /Q /Y "C:\TEST\import\01*.*" "C:\TEST\active\" ...and it works

4. Delete folder "01" inside "import". I use command:
RMDIR /S /Q "C:\TEST\import\01" ...and it works

After step "4" I use image editor to auto resize picture.

5. Copy resize pictures from folder "active" to folder "01" in "exported". I use command:
xcopy /Q /Y "C:\TEST\active" "C:\TEST\exported\01" ...and it works

6. Delete all pictures inside folder "active". I use command:
DEL /Q "C:\TEST\active" ...and it works

-->How to create loop or whatever, that will allow me when I repeat all stpes again....to check folder 02,03,04...folder "X" and so on until it reaches the end automaticli? This applies to step 3?

--> When I finish three or four folders I manualy rename all folders in "export"....."01" to "Dog"...."02" to "Cats".....X to X and so on. Is there an easier way?


#2 User is offline   allen2 

  • Not really Newbie
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,439
  • Joined: 13-January 06

Posted 07 February 2012 - 11:06 PM

I would do the whole process differently with imagemagick (which is free and work from command line) and as it is already explained with code there i won't try reinventing the wheel, you'll just need to add the folder creation on the target folder.

This post has been edited by allen2: 07 February 2012 - 11:08 PM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy