Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- iniread(Filename="", Section="", Key=""){
- IniRead, Var, %Filename%, %Section%, %Key%
- return %var%
- }
- StringReplace(InputVar="", SearchText="" , ReplaceText="", ReplaceAll=1){
- StringReplace,var, InputVar, %SearchText%, %ReplaceText%, %ReplaceAll%
- return %var%
- }
- param = %1%
- #include ftp.ahk
- #include unrar.ahk
- FtpHost := % iniread("set.ini", "base", "FTP_host")
- FtpPort := % iniread("set.ini", "base", "FTP_port")
- FtpUsername := % iniread("set.ini", "base", "FTP_user")
- FtpPassword := % iniread("set.ini", "base", "FTP_pass")
- ininame = set.ini
- if param = manuell
- InputBox, index , manueller start, Eingabe Vertreternummer
- else
- IniRead, index, %ininame%, Base, Index
- StringSplit, index_array, index ,|
- connect:
- FtpConnection := FtpOpen(FtpHost, FtpPort, FtpUsername, FtpPassword)
- If (FtpConnection != 1)
- {
- MsgBox, Error connecting to FTP server.
- ;GoSub, quit
- }
- loop, %index_array0%
- {
- V_Num := index_array%a_index%
- FTP_File := StringReplace(iniread("set.ini", "base", "FTP_Basepath"),"##",V_Num )
- RAR_File := StringReplace(iniread("set.ini", "base", "LOC_decompress"),"##",V_Num )
- RAR_Move := StringReplace(iniread("set.ini", "base", "LOC_Movepath"),"##",V_Num )
- LOC_File := StringReplace(iniread("set.ini", "base", "LOC_Basepath"),"##",V_Num )
- TrayTip , Status, Download export.rar / Vertreter%V_Num%, 2
- SplitPath, RAR_File,, rar_dir
- ifnotexist %rar_dir%
- FileCreateDir, %rar_dir%
- FtpGetFile(FTP_File,RAR_File)
- TrayTip , Status, Entpacke export.rar / Vertreter%V_Num%, 2
- ExtractRAR(RAR_File, LOC_File)
- TrayTip , Status, Speichern: Belege.mdb / Vertreter%V_Num%, 2
- FileMove, %LOC_File%\%RAR_Move%, %LOC_File%
- ;SplitPath, RAR_move,, mdb_dir
- FileRemoveDir, %LOC_File%/phs,1
- FileDelete, %RAR_File%
- }
- FtpClose()
- FileRemoveDir, temp,1
- exitapp
- quit:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement