Mulawin Posted January 10, 2006 Share Posted January 10, 2006 ChrisL help me 1st at the revival by thatsgreat2345 New Owner of this AU account Link to comment Share on other sites More sharing options...
Mulawin Posted January 10, 2006 Share Posted January 10, 2006 ok help me with the thing New Owner of this AU account Link to comment Share on other sites More sharing options...
Mulawin Posted January 10, 2006 Share Posted January 10, 2006 move on back to the topic New Owner of this AU account Link to comment Share on other sites More sharing options...
ChrisL Posted January 10, 2006 Share Posted January 10, 2006 I'm still not entirely sure what your on about, the below script will only allow a single file to be copied at a time, took out the 1 minute delay so as soon as the out folder is empty then the next file gets copied, you can change the number of allowed files in the out folder.. still not convinced this is what you want though! expandcollapse popup#include <Process.au3> #include <file.au3> $ini_file = @ScriptDir&"\settings.ini" $file = FileOpen($ini_file, 0) $source = FileReadLine($file,1) $destination = FileReadLine($file,2) FileClose($file) TrayTip("Started", "Folder: "&$source, 5, 1) TraySetState() TraySetToolTip("Copyfiles") HotKeySet("{PAUSE}","IHopeImNotTheOnlyOneThatLaughsAtMyComicallyLongFunctionNamesImAnAss") $tosearch = $source while 1 RecFileSearch($tosearch) ;sleep(60000) removed sleep and only allow set number of files to be copied before waiting WEnd Func RecFileSearch($current) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file)<1 Then ExitLoop If not StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) then if Stringright ($file, 3) = "pdf" or Stringright ($file, 3) = "idx" or Stringright ($file, 3) = "rdy" then ;######################## This section only allows a single file to be copied at once untill removed from the out path, you can change the number of allowed files below If size() > 1 While 1 If Size() < 1 then FileCopy($current & "\" & $file, $destination & "\" & $File) ExitLoop Else Sleep (1000) EndIf Wend ;######################## Endif Endif If StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) Then RecFileSearch($current & "\" & $file) Endif WEnd FileClose($search) EndFunc Func IHopeImNotTheOnlyOneThatLaughsAtMyComicallyLongFunctionNamesImAnAss() Exit EndFunc Func Size() $DirSize = DirGetSize( $destination , 1 ) return $DirSize[1] EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
quicksilver Posted January 10, 2006 Author Share Posted January 10, 2006 (edited) the script seems to work nice.. but i only want to copy all the files in One folder. not one file step to step... i want all the files in one folder... than the next you understand? folders: in\LP_2000_01\ files in it bla_n.txt bla_n.rdy bla_n.pdf bla_n.idx in\LP_2000_02\ files in it bla_n.txt bla_n.rdy bla_n.pdf bla_n.idx in\LP_2000_03\ files in it bla_n.txt bla_n.rdy bla_n.pdf bla_n.idx in\LP_2000_04\ files in it bla_n.txt bla_n.rdy bla_n.pdf bla_n.idx step 1 copy all files (*.pdf,*.idx,*.rdy) from LP_2000_01 to out look into out if its empty.. when its empty go to the next folder LP_2000_02 and copy all files (*.pdf,*.idx,*.rdy) to out ... look into out if its empty.. when its empty go to the next folder LP_2000_03 and copy all files (*.pdf,*.idx,*.rdy) to out ... .. .. Edited January 10, 2006 by quicksilver Link to comment Share on other sites More sharing options...
ChrisL Posted January 10, 2006 Share Posted January 10, 2006 (edited) Will do 1 directory at a time while "out" is empty edited.. forgot to get rid of the sleep! expandcollapse popup#include <Process.au3> #include <file.au3> $ini_file = @ScriptDir&"\settings.ini" $file = FileOpen($ini_file, 0) $source = FileReadLine($file,1) $destination = FileReadLine($file,2) FileClose($file) TrayTip("Started", "Folder: "&$source, 5, 1) TraySetState() TraySetToolTip("Copyfiles") HotKeySet("{PAUSE}","IHopeImNotTheOnlyOneThatLaughsAtMyComicallyLongFunctionNamesImAnAss") $tosearch = $source while 1 RecFileSearch($tosearch) ;sleep(60000) ******Edit comment out this sleep WEnd Func RecFileSearch($current) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file)<1 Then ExitLoop If not StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) then if Stringright ($file, 3) = "pdf" or Stringright ($file, 3) = "idx" or Stringright ($file, 3) = "rdy" then Filemove($current & "\" & $file, $destination & "\" & $File) Endif If StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) Then While Size() > 1 Sleep (1000) Wend RecFileSearch($current & "\" & $file) Endif WEnd FileClose($search) EndFunc Func IHopeImNotTheOnlyOneThatLaughsAtMyComicallyLongFunctionNamesImAnAss() Exit EndFunc Func Size() $DirSize = DirGetSize( $destination , 1 ) return $DirSize[1] EndFunc Edited January 10, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
quicksilver Posted January 10, 2006 Author Share Posted January 10, 2006 Really Nice it works fine.. now i had to change the filemove into copy and create a backup of the files and everything is fine.. Big thanks Chris L Link to comment Share on other sites More sharing options...
ChrisL Posted January 10, 2006 Share Posted January 10, 2006 Really Nice it works fine.. now i had to change the filemove into copy and create a backup of the files and everything is fine..Big thanks Chris LLOL.. I had filecopy in before but I thought you wanted to move them!No worries [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
quicksilver Posted January 10, 2006 Author Share Posted January 10, 2006 (edited) yes and whats the command to move the folder which has been copied into a third backup folder? where i can i add the line in the script? expandcollapse popup#include <Process.au3> #include <file.au3> $ini_file = @ScriptDir&"\settings.ini" $file = FileOpen($ini_file, 0) $source = FileReadLine($file,1) $destination = FileReadLine($file,2) $backup = FileReadLine($file,3) FileClose($file) TrayTip("Started", "Folder: "&$source, 5, 1) TraySetState() TraySetToolTip("copy") HotKeySet("{PAUSE}","IHopeImNotTheOnlyOneThatLaughsAtMyComicallyLongFunctionNamesImAnAss") $tosearch = $source while 1 RecFileSearch($tosearch) sleep(60000) WEnd Func RecFileSearch($current) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file)<1 Then ExitLoop If not StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) then if Stringright ($file, 3) = "pdf" or Stringright ($file, 3) = "idx" or Stringright ($file, 3) = "rdy" then Filecopy($current & "\" & $file, $destination & "\" & $File) Endif If StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) Then While Size() > 1 Sleep (1000) Wend RecFileSearch($current & "\" & $file) Endif WEnd DirMove($current, $backup& "\") FileClose($search) EndFunc Func IHopeImNotTheOnlyOneThatLaughsAtMyComicallyLongFunctionNamesImAnAss() Exit EndFunc Func Size() $DirSize = DirGetSize( $destination , 1 ) return $DirSize[1] EndFunc this doesnt work Edited January 10, 2006 by quicksilver Link to comment Share on other sites More sharing options...
ChrisL Posted January 10, 2006 Share Posted January 10, 2006 yes and whats the command to move the folder which has been copied into a third backup folder? where i can i add the line in the script? Add backup Dir to line 3 of the ini file.. I haven't tried this properly though!! expandcollapse popup#include <Process.au3> #include <file.au3> $ini_file = @ScriptDir&"\settings.ini" $file = FileOpen($ini_file, 0) $source = FileReadLine($file,1) $destination = FileReadLine($file,2) $BackupDir = FileReadLine($file,3) FileClose($file) TrayTip("Started", "Folder: "&$source, 5, 1) TraySetState() TraySetToolTip("Copyfiles") HotKeySet("{PAUSE}","IHopeImNotTheOnlyOneThatLaughsAtMyComicallyLongFunctionNamesImAnAss") $tosearch = $source Dim $Working while 1 RecFileSearch($tosearch) DirMove ($tosearch & $Working, $backupDir & $Working) sleep(1000) WEnd Func RecFileSearch($current) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file)<1 Then ExitLoop If not StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) then if Stringright ($file, 3) = "exe" or Stringright ($file, 3) = "idx" or Stringright ($file, 3) = "rdy" then Filecopy($current & "\" & $file, $destination & "\" & $File) Endif If StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) Then While Size() > 1 Sleep (1000) Wend $working = "\" & $File RecFileSearch($current & "\" & $file) Endif WEnd FileClose($search) EndFunc Func IHopeImNotTheOnlyOneThatLaughsAtMyComicallyLongFunctionNamesImAnAss() Exit EndFunc Func Size() $DirSize = DirGetSize( $destination , 1 ) return $DirSize[1] EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
quicksilver Posted January 10, 2006 Author Share Posted January 10, 2006 hmm doesnt work.. he stops to copy the files... and doesnt move the dir Link to comment Share on other sites More sharing options...
ChrisL Posted January 10, 2006 Share Posted January 10, 2006 Any better? expandcollapse popup#include <Process.au3> #include <file.au3> $ini_file = @ScriptDir&"\settings.ini" $file = FileOpen($ini_file, 0) $source = FileReadLine($file,1) $destination = FileReadLine($file,2) $BackupDir = FileReadLine($file,3) FileClose($file) TrayTip("Started", "Folder: "&$source, 5, 1) TraySetState() TraySetToolTip("Copyfiles") HotKeySet("{PAUSE}","IHopeImNotTheOnlyOneThatLaughsAtMyComicallyLongFunctionNamesImAnAss") $tosearch = $source while 1 RecFileSearch($tosearch) sleep(1000) WEnd Func RecFileSearch($current) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file)<1 Then ExitLoop If not StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) then ;if Stringright ($file, 3) = "pdf" or Stringright ($file, 3) = "idx" or Stringright ($file, 3) = "rdy" then Filecopy($current & "\" & $file, $destination & "\" & $File) Endif If StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) Then While Size() > 1 Sleep (1000) Wend $working = "\" & $File ;MsgBox (0,"Backup", $tosearch & $Working & " to " & $backupDir & $Working) RecFileSearch($current & "\" & $file) DirMove ($tosearch & $Working, $backupDir & $Working) Endif WEnd FileClose($search) EndFunc Func IHopeImNotTheOnlyOneThatLaughsAtMyComicallyLongFunctionNamesImAnAss() Exit EndFunc Func Size() $DirSize = DirGetSize( $destination , 1 ) return $DirSize[1] EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
quicksilver Posted January 10, 2006 Author Share Posted January 10, 2006 After fix one Problem it works really really Fine Big thanks again !!! Link to comment Share on other sites More sharing options...
ChrisL Posted January 10, 2006 Share Posted January 10, 2006 After fix one Problem it works really really Fine Big thanks again !!!What did you have to fix? [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
quicksilver Posted January 10, 2006 Author Share Posted January 10, 2006 This is the finished Script: The filter *.pdf,*,idx,*.rdy was disabled expandcollapse popup#include <Process.au3> #include <file.au3> $ini_file = @ScriptDir&"\settings.ini" $file = FileOpen($ini_file, 0) $source = FileReadLine($file,1) $destination = FileReadLine($file,2) $BackupDir = FileReadLine($file,3) FileClose($file) TrayTip("Started", "Folder: "&$source, 5, 1) TraySetState() TraySetToolTip("Copyfiles") HotKeySet("{PAUSE}","IHopeImNotTheOnlyOneThatLaughsAtMyComicallyLongFunctionNamesImAnAss") $tosearch = $source Func RecFileSearch($current) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file)<1 Then ExitLoop If not StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) then if Stringright ($file, 3) = "pdf" or Stringright ($file, 3) = "idx" or Stringright ($file, 3) = "rdy" then Filecopy($current & "\" & $file, $destination & "\" & $File) Endif If StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) Then While Size() > 1 Sleep (1000) Wend $working = "\" & $File RecFileSearch($current & "\" & $file) DirMove ($tosearch & $Working, $backupDir & $Working) Endif WEnd FileClose($search) EndFunc Func IHopeImNotTheOnlyOneThatLaughsAtMyComicallyLongFunctionNamesImAnAss() Exit EndFunc Func Size() $DirSize = DirGetSize( $destination , 1 ) return $DirSize[1] EndFunc while 1 RecFileSearch($tosearch) sleep(1000) WEnd Link to comment Share on other sites More sharing options...
ChrisL Posted January 10, 2006 Share Posted January 10, 2006 This is the finished Script:The filter *.pdf,*,idx,*.rdy was disabled ahh thats cos when i tried it i didnt have those file types in my directory so i dissabled it [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now