daily pastebin goal
86%
SHARE
TWEET

Untitled

a guest Jun 4th, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. iniread(Filename="", Section="", Key=""){
  2. IniRead, Var, %Filename%, %Section%, %Key%
  3. return %var%
  4. }
  5. StringReplace(InputVar="", SearchText="" , ReplaceText="", ReplaceAll=1){
  6. StringReplace,var, InputVar, %SearchText%, %ReplaceText%, %ReplaceAll%
  7. return %var%
  8. }
  9.  
  10. param = %1%
  11. #include ftp.ahk
  12. #include unrar.ahk
  13. FtpHost := % iniread("set.ini", "base", "FTP_host")
  14. FtpPort := % iniread("set.ini", "base", "FTP_port")
  15. FtpUsername := % iniread("set.ini", "base", "FTP_user")
  16. FtpPassword := % iniread("set.ini", "base", "FTP_pass")
  17. ininame = set.ini
  18.  
  19. if param = manuell
  20. InputBox, index , manueller start, Eingabe Vertreternummer
  21. else
  22. IniRead, index, %ininame%, Base, Index
  23. StringSplit, index_array, index ,|
  24.  
  25. connect:
  26.    FtpConnection := FtpOpen(FtpHost, FtpPort, FtpUsername, FtpPassword)
  27.    If (FtpConnection != 1)
  28.    {
  29.       MsgBox, Error connecting to FTP server.
  30.       ;GoSub, quit
  31.    }
  32. loop, %index_array0%
  33. {
  34. V_Num := index_array%a_index%
  35. FTP_File := StringReplace(iniread("set.ini", "base", "FTP_Basepath"),"##",V_Num )
  36. RAR_File := StringReplace(iniread("set.ini", "base", "LOC_decompress"),"##",V_Num )
  37. RAR_Move := StringReplace(iniread("set.ini", "base", "LOC_Movepath"),"##",V_Num )
  38. LOC_File := StringReplace(iniread("set.ini", "base", "LOC_Basepath"),"##",V_Num )
  39. TrayTip , Status, Download export.rar / Vertreter%V_Num%, 2
  40. SplitPath, RAR_File,, rar_dir
  41.  
  42. ifnotexist %rar_dir%
  43. FileCreateDir, %rar_dir%
  44.  
  45. FtpGetFile(FTP_File,RAR_File)
  46. TrayTip , Status, Entpacke export.rar / Vertreter%V_Num%, 2
  47. ExtractRAR(RAR_File, LOC_File)
  48. TrayTip , Status, Speichern: Belege.mdb / Vertreter%V_Num%, 2
  49. FileMove, %LOC_File%\%RAR_Move%, %LOC_File%
  50.  
  51. ;SplitPath, RAR_move,, mdb_dir
  52.  
  53. FileRemoveDir, %LOC_File%/phs,1
  54. FileDelete, %RAR_File%
  55. }
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.    FtpClose()
  63. FileRemoveDir, temp,1
  64. exitapp
  65.  
  66.  
  67. quit:
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top