Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;@Ahk2Exe-SetCompanyName VANHEARTNET LTD. INC.
- ;@Ahk2Exe-SetCopyright All rights reserved © VANHEARTNET
- ;@Ahk2Exe-Set FileDescription, Auto Copy Delete Move
- ;@Ahk2Exe-Set FileVersion, 3.0.0.0
- ;@Ahk2Exe-SetInternalName AutoCDM
- ;@Ahk2Exe-SetName GPoints AutoCDM
- ;@Ahk2Exe-SetOrigFileName AutoCDM
- ;@Ahk2Exe-Set ProductName, AutoCDM
- ;@Ahk2Exe-Set ProductVersion, 3.0.0.0
- ;@Ahk2Exe-Set Description, AutoCDM
- ;@Ahk2Exe-Set Comments, Software Created by : VANHEARTNET
- #SingleInstance, Force
- #NoEnv
- #Persistent
- SetWorkingDir, %A_ScriptDir%
- SetTitleMatchMode,1
- IfNotExist,Config.ini
- {
- IniWrite,Source,Config.ini,FILE PATH,FROM
- Iniwrite,Destination,Config.ini,FILE PATH,TO
- FileAppend,`n`n,Config.ini
- Iniwrite,1,Config.ini,FILE PATH,AutoCopy
- IniWrite,0,Config.ini,FILE PATH,AutoDelete
- Iniwrite,0,Config.ini,FILE PATH,AutoMove
- FileAppend,`n`n0 = Disabled`n1 = Specific Folder/Files Only`n2 = All Files/Folders Inside a Specific Folder `n`n`n(Important: To Include more Path at the same time (AutoDelete) `nJust Type "MANY" in/after "FROM" in Config.ini `nDo not include the Filename in FILE PATH)`n`nNOTE:`nFiles cannot be recovered after deleted using this program.`nMake sure to backup the Files before running the program.`nUse it at your own risk! Thank You!`n`n-VANHEARTNET,Config.ini
- MsgBox,64, Thank You!,Please input the Source and Destination path in "Config.ini" file...,5
- }
- else
- {
- Iniread,AutoC,Config.ini,FILE PATH,AutoCopy
- If (AutoC==1)
- {
- IniWrite,0,Config.ini,FILE PATH,AutoDelete
- IniWrite,0,Config.ini,FILE PATH,AutoMove
- IniRead,SR,Config.ini,FILE PATH,FROM
- if (SR="ERROR") or (SR="")
- {
- IniWrite,Source,Config.ini,FILE PATH,FROM
- MsgBox,16,AutoCopy Error, Please Input the Source Filename Location
- }
- else
- {
- IniRead,DT,Config.ini,FILE PATH,TO
- if (DT="ERROR") or (DT="")
- {
- Iniwrite,Destination,Config.ini,FILE PATH,TO
- MsgBox,16,AutoCopy Error, Please Input the Destination Filename Location
- }
- else
- {
- FileCopyDir,%SR%,%DT%,1
- if (Errorlevel=1)
- {
- IfExist,%SR%
- {
- FileCopy,%SR%,%DT%,1
- If (errorlevel=1)
- {
- IniWrite,[Please Edit this],Config.ini,FILE PATH,FROM
- IniWrite,[Please Edit this],Config.ini,FILE PATH,TO
- MsgBox,16,AutoCopy Error, Please Check the Source or Destination Path!,5
- }
- }
- else
- {
- IniWrite,[Please Edit this],Config.ini,FILE PATH,FROM
- IniWrite,[Please Edit this],Config.ini,FILE PATH,TO
- MsgBox,16,AutoCopy Error, Please Check the Source or Destination Path!,5
- }
- }
- }
- }
- ExitApp
- }
- Else if (AutoC==2)
- {
- Iniread,SRAll,Config.ini,FILE PATH,FROM
- Iniread,DTAll,Config.ini,FILE PATH,TO
- Loop,%SRAll%\*.*,1
- {
- IfNotExist,% SRAll
- {
- MsgBox, 16, Auto Copy, File Path Not Found!!!`n`n%SRAll%, 5
- ExitApp
- }
- FileCopyDir,%SRAll%\%A_LoopFileName%,%DTAll%\%A_LoopFileName%,1
- if (errorlevel=1)
- {
- FileCopy,%SRAll%\%A_LoopFileName%,%DTAll%\%A_LoopFileName%,1
- if (errorlevel=1)
- {
- IniWrite,[Please Edit this],Config.ini,FILE PATH,FROM
- IniWrite,[Please Edit this],Config.ini,FILE PATH,TO
- MsgBox,16,AutoCopy Error, Please Check the Source or Destination Path!,5
- }
- }
- }
- ExitApp
- }
- Else if (AutoC="ERROR") or (AutoC="") or (AutoC==0)
- {
- IniWrite,0,Config.ini,FILE PATH,AutoCopy
- Goto, AutoDM
- }
- Else if (AutoC==0)
- {
- Goto, AutoDM
- }
- else
- {
- IniWrite,0,Config.ini,FILE PATH,AutoCopy
- MsgBox,48,AutoCopy Warning, Please Enable one Settings using " 1 or 0 " ONLY.
- ExitApp
- }
- }
- ExitApp
- AutoDM:
- Iniread,AutoD,Config.ini,FILE PATH,AutoDelete
- If (AutoD==1)
- {
- IniRead,SRD,Config.ini,FILE PATH,FROM
- IniWrite,[DISABLED],Config.ini,FILE PATH,TO
- IniWrite,0,Config.ini,FILE PATH,AutoMove
- If (SRD="MANY")
- {
- IfNotExist,MultiPath.txt
- {
- FileAppend,,MultiPath.txt
- MsgBox,64,Message, Please Enter the list of paths to be deleted in "MultiPath.txt".
- ExitApp
- }
- else
- {
- Loop,read,MultiPath.txt
- {
- Loop,parse,A_LoopReadLine,`n
- {
- IfNotExist,% A_Loopfield
- {
- MsgBox, 16, AutoDelete Many, File Path Not Found!!!`n`n%A_Loopfield%, 5
- ExitApp
- }
- FileRemoveDir,%A_LoopField%,1
- If (errorlevel=1)
- {
- FileDelete,%A_LoopField%
- If (errorlevel)
- {
- MsgBox,16,AutoDelete Error, Please specify the correct filename and location!,5
- }
- }
- }
- }
- ExitApp
- }
- }
- else
- {
- IniWrite,[DISABLED],Config.ini,FILE PATH,TO
- IniWrite,0,Config.ini,FILE PATH,AutoMove
- FileRemoveDir,%SRD%,1
- If (errorlevel=1)
- {
- FileDelete,%SRD%
- If (errorlevel)
- {
- IniWrite,[Input Filename and location here],Config.ini,FILE PATH,FROM
- MsgBox,16,AutoDelete Error, Please specify the correct filename and location!,5
- }
- }
- ExitApp
- }
- }
- Else if (AutoD==2)
- {
- Iniread,SRDAll,Config.ini,FILE PATH,FROM
- IniWrite,[DISABLED],Config.ini,FILE PATH,TO
- IniWrite,0,Config.ini,FILE PATH,AutoMove
- IniWrite,0,Config.ini,FILE PATH,AutoCopy
- If (SRDAll="MANY")
- {
- IfNotExist,MultiPath.txt
- {
- FileAppend,,MultiPath.txt
- MsgBox,64,Message, Please Enter the list of paths to be deleted in "MultiPath.txt".
- ExitApp
- }
- else
- {
- Loop,read,MultiPath.txt
- {
- Loop,parse,A_LoopReadLine,`n
- {
- IfNotExist,% A_Loopfield
- {
- MsgBox, 16, AutoDelete Many, File Path Not Found!!!`n`n%A_Loopfield%, 5
- ExitApp
- }
- Loop,%A_LoopField%\*.*,1
- {
- FileRemoveDir,%A_LoopField%\%A_LoopFileName%,1
- }
- }
- }
- }
- ExitApp
- }
- else
- {
- Loop,%SRDAll%\*.*,1
- {
- FileRemoveDir,%SRDAll%\%A_LoopFileName%,1
- if (errorlevel=1)
- {
- FileDelete,%SRDAll%\%A_LoopFileName%
- if (errorlevel=1)
- {
- IniWrite,[Input Filename and location here],Config.ini,FILE PATH,FROM
- MsgBox,16,AutoDelete Error, Please specify the correct filename and location!,5
- }
- }
- }
- ExitApp
- }
- }
- else if(AutoD="ERROR") or (AutoD="")
- {
- IniWrite,0,Config.ini,FILE PATH,AutoDelete
- Goto, AutoMM
- }
- else if (AutoD==0)
- {
- Goto, AutoMM
- }
- else
- {
- IniWrite,0,Config.ini,FILE PATH,AutoDelete
- MsgBox,48,AutoDelete Warning, Please Enable one Settings using " 1 or 0 " ONLY.
- ExitApp
- }
- return
- AutoMM:
- Iniread,AutoM,Config.ini,FILE PATH,AutoMove
- If (AutoM==1)
- {
- IniWrite,0,Config.ini,FILE PATH,AutoDelete
- IniWrite,0,Config.ini,FILE PATH,AutoCopy
- IniRead,SRM,Config.ini,FILE PATH,FROM
- IniRead,SRM1,Config.ini,FILE PATH,TO
- FileMoveDir,%SRM%,%SRM1%,2
- If (Errorlevel=1)
- {
- IfExist, %SRM%
- {
- ifExist,%SRM1%
- {
- FileMove,%SRM%,%SRM1%,1
- If (errorlevel)
- {
- IniWrite,[Edit This],Config.ini,FILE PATH,FROM
- IniWrite,[Edit This],Config.ini,FILE PATH,TO
- MsgBox,16,AutoMove Error, Please specify the correct filename and location!,5
- ExitApp
- }
- ExitApp
- }
- else
- {
- IniWrite,[Edit This],Config.ini,FILE PATH,FROM
- IniWrite,[Edit This],Config.ini,FILE PATH,TO
- MsgBox,16,AutoMove Error, Please specify the correct filename and location!,5
- ExitApp
- }
- }
- else
- {
- IniWrite,[Edit This],Config.ini,FILE PATH,FROM
- IniWrite,[Edit This],Config.ini,FILE PATH,TO
- MsgBox,16,AutoMove Error, Please specify the correct filename and location!,5
- ExitApp
- }
- }
- }
- Else if (AutoM==2)
- {
- Iniread,SRMAll,Config.ini,FILE PATH,FROM
- Iniread,DTMAll,Config.ini,FILE PATH,TO
- IniWrite,0,Config.ini,FILE PATH,AutoDelete
- IniWrite,0,Config.ini,FILE PATH,AutoCopy
- Loop,%SRMAll%\*.*,1
- {
- FileMoveDir,%SRMAll%\%A_LoopFileName%,%DTMAll%\%A_LoopFileName%,2
- if (errorlevel=1)
- {
- FileMove,%SRMAll%\%A_LoopFileName%,%DTMAll%\%A_LoopFileName%,1
- if (errorlevel=1)
- {
- IniWrite,[Edit This],Config.ini,FILE PATH,FROM
- IniWrite,[Edit This],Config.ini,FILE PATH,TO
- MsgBox,16,AutoMove Error, Please specify the correct filename and location!,5
- ExitApp
- }
- }
- }
- ExitApp
- }
- Else if(AutoM="ERROR") or (AutoM="")
- {
- IniWrite,0,Config.ini,FILE PATH,AutoMove
- MsgBox,48,AutoMove Warning, Please Enable one Settings using " 1 or 0 " ONLY.,10
- ExitApp
- }
- Else if (AutoM==0)
- {
- MsgBox,32,AutoCDM Message, Nothing is Enabled.,10
- ExitApp
- }
- else
- {
- IniWrite,0,Config.ini,FILE PATH,AutoMove
- MsgBox,48,AutoMove Warning, Please Enable one Settings using " 1 or 0 " ONLY.,10
- ExitApp
- }
- return
- MultiPath:
- Loop,read, MultiPath.txt
- {
- Loop,parse,A_LoopReadLine,`n`r%A_Space%%A_Tab%
- {
- Fileread,MTPATHS,%A_LoopField%
- }
- }
- return
- Esc::
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement