DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Final pieces of program  (Read 4,827 times)

KoenFugro

  • Participant
  • Joined in 2008
  • *
  • Posts: 26
Final pieces of program
« on: October 27, 2008, 10:34 AM »
Hi, i'am not sure if i am posting this in the right folder;
Skrommel made me this script, thanks for that :D

It is almost working, 1 crucial thing is not; the script only loops the 2 folders in the root. The loop must also contain subdirectories.
So when there is a tiff in \\sanfolder1\folder\folder\tiff.tiff
And in \\sanfolder2\folder\example\tioff.tiff

It also has to move the tiff into the output folder..

I add the script in my post, does anyone know how to loop also the subfolders?
Please help.. :o

MsgBox, EBN PDF-TIFF zoek tool v1.0 Zet de exe in de root van de te sorteren map met PDF's!

;Set variable for output folder

localfolder=d:\PDFS                  ;EBN Weebverzending PDF
sanfolder1=d:\san1          ;SAN Folder1
sanfolder2=d:\san2          ;SAN Folder2


Loop,%localfolder%\*,1            ;Zoekt door de weekverzending
{
  IfInString,A_LoopFileAttrib,D    ;Kijkt of er mappen zijn
  {
    MOVE(A_LoopFileName,sanfolder1,A_LoopFileFullPath) ;Kijkt of diezelfde map bestaat in de sanfolder1
    MOVE(A_LoopFileName,sanfolder2,A_LoopFileFullPath)  ;Kijkt of diezelfde map bestaat in de sanfolder2
  }
}


 


ExitAPP





MOVE(find,root,target)

{
  Loop,%root%\*,1            ;Zoekt door de root van de sanfolders
{
    IfInString,A_LoopFileAttrib,D 
    If (A_LoopFileName=find)      ;Als er een match is...
    {
      FileMoveDir,%A_LoopFileFullPath%,d:\output\%find%  ;Verplaats de map naar de lokale folder
      Break
    }
  }
}

VideoInPicture

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 467
    • Coding Snacks
Re: Final pieces of program
« Reply #1 on: October 28, 2008, 03:18 AM »
From this thread http://www.donationcoder.com/forum/index.php?topic=14553.0 Skrommel wrote some AHK code that loops through a folder including the subdirectories and moves files out:

Example to move files out that have a .msf extension:
Code: (autoit)
FileSelectFolder,folder,,2,Please select a folder
If folder=
  ExitApp
Loop,%folder%\*.msf,0,1
{
  SplitPath,A_LoopFileLongPath,name,dir,ext,name_no_ext,drive
  IfExist,%dir%\%name_no_ext%.sbd
  {
    FileGetAttrib,attrib,%dir%\%name_no_ext%.sbd
    IfInString,attrib,D
      FileMove,%dir%\%name_no_ext%.msf,%dir%\%name_no_ext%.msf.old
  }
}

I think you might simple have to change your loop lines to something with the "0, 1" parameters attached to the end.
Author of Circle Dock: http://circledock.wikidot.com
Author of Video In Picture: http://videoinpicture.wikidot.com
Author of Webcam Signature: http://webcamsignature.wikidot.com
Author of Easy Unicode Paster: http://easyunicodepaster.wikidot.com
« Last Edit: October 28, 2008, 03:20 AM by VideoInPicture »

Original address: https://www.donationcoder.com/forum/index.php?topic=15496.0