Advertisement
vanheartnet

AutoCDM3

Feb 28th, 2020 (edited)
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.25 KB | None | 0 0
  1. ;@Ahk2Exe-SetCompanyName VANHEARTNET LTD. INC.
  2. ;@Ahk2Exe-SetCopyright All rights reserved © VANHEARTNET
  3. ;@Ahk2Exe-Set FileDescription, Auto Copy Delete Move
  4. ;@Ahk2Exe-Set FileVersion, 3.0.0.0
  5. ;@Ahk2Exe-SetInternalName AutoCDM
  6. ;@Ahk2Exe-SetName GPoints AutoCDM
  7. ;@Ahk2Exe-SetOrigFileName AutoCDM
  8. ;@Ahk2Exe-Set ProductName, AutoCDM
  9. ;@Ahk2Exe-Set ProductVersion, 3.0.0.0
  10. ;@Ahk2Exe-Set Description, AutoCDM
  11. ;@Ahk2Exe-Set Comments, Software Created by : VANHEARTNET
  12.  
  13.  
  14. #SingleInstance, Force
  15. #NoEnv
  16. #Persistent
  17. SetWorkingDir, %A_ScriptDir%
  18. SetTitleMatchMode,1
  19.  
  20.  
  21. IfNotExist,Config.ini
  22. {
  23. IniWrite,Source,Config.ini,FILE PATH,FROM
  24. Iniwrite,Destination,Config.ini,FILE PATH,TO
  25. FileAppend,`n`n,Config.ini
  26. Iniwrite,1,Config.ini,FILE PATH,AutoCopy
  27. IniWrite,0,Config.ini,FILE PATH,AutoDelete
  28. Iniwrite,0,Config.ini,FILE PATH,AutoMove
  29. 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
  30. MsgBox,64, Thank You!,Please input the Source and Destination path in "Config.ini" file...,5
  31. }
  32. else
  33. {
  34. Iniread,AutoC,Config.ini,FILE PATH,AutoCopy
  35. If (AutoC==1)
  36. {
  37. IniWrite,0,Config.ini,FILE PATH,AutoDelete
  38. IniWrite,0,Config.ini,FILE PATH,AutoMove
  39. IniRead,SR,Config.ini,FILE PATH,FROM
  40. if (SR="ERROR") or (SR="")
  41. {
  42. IniWrite,Source,Config.ini,FILE PATH,FROM
  43. MsgBox,16,AutoCopy Error, Please Input the Source Filename Location
  44. }
  45. else
  46. {
  47. IniRead,DT,Config.ini,FILE PATH,TO
  48. if (DT="ERROR") or (DT="")
  49. {
  50. Iniwrite,Destination,Config.ini,FILE PATH,TO
  51. MsgBox,16,AutoCopy Error, Please Input the Destination Filename Location
  52. }
  53. else
  54. {
  55. FileCopyDir,%SR%,%DT%,1
  56. if (Errorlevel=1)
  57. {
  58. IfExist,%SR%
  59. {
  60.  
  61. FileCopy,%SR%,%DT%,1
  62. If (errorlevel=1)
  63. {
  64. IniWrite,[Please Edit this],Config.ini,FILE PATH,FROM
  65. IniWrite,[Please Edit this],Config.ini,FILE PATH,TO
  66. MsgBox,16,AutoCopy Error, Please Check the Source or Destination Path!,5
  67. }
  68. }
  69. else
  70. {
  71. IniWrite,[Please Edit this],Config.ini,FILE PATH,FROM
  72. IniWrite,[Please Edit this],Config.ini,FILE PATH,TO
  73. MsgBox,16,AutoCopy Error, Please Check the Source or Destination Path!,5
  74. }
  75. }
  76. }
  77. }
  78. ExitApp
  79. }
  80. Else if (AutoC==2)
  81. {
  82. Iniread,SRAll,Config.ini,FILE PATH,FROM
  83. Iniread,DTAll,Config.ini,FILE PATH,TO
  84. Loop,%SRAll%\*.*,1
  85. {
  86. IfNotExist,% SRAll
  87. {
  88. MsgBox, 16, Auto Copy, File Path Not Found!!!`n`n%SRAll%, 5
  89. ExitApp
  90. }
  91. FileCopyDir,%SRAll%\%A_LoopFileName%,%DTAll%\%A_LoopFileName%,1
  92. if (errorlevel=1)
  93. {
  94. FileCopy,%SRAll%\%A_LoopFileName%,%DTAll%\%A_LoopFileName%,1
  95. if (errorlevel=1)
  96. {
  97. IniWrite,[Please Edit this],Config.ini,FILE PATH,FROM
  98. IniWrite,[Please Edit this],Config.ini,FILE PATH,TO
  99. MsgBox,16,AutoCopy Error, Please Check the Source or Destination Path!,5
  100. }
  101. }
  102. }
  103. ExitApp
  104. }
  105. Else if (AutoC="ERROR") or (AutoC="") or (AutoC==0)
  106. {
  107. IniWrite,0,Config.ini,FILE PATH,AutoCopy
  108. Goto, AutoDM
  109. }
  110. Else if (AutoC==0)
  111. {
  112. Goto, AutoDM
  113. }
  114. else
  115. {
  116. IniWrite,0,Config.ini,FILE PATH,AutoCopy
  117. MsgBox,48,AutoCopy Warning, Please Enable one Settings using " 1 or 0 " ONLY.
  118. ExitApp
  119. }
  120. }
  121.  
  122.  
  123.  
  124. ExitApp
  125.  
  126. AutoDM:
  127. Iniread,AutoD,Config.ini,FILE PATH,AutoDelete
  128. If (AutoD==1)
  129. {
  130. IniRead,SRD,Config.ini,FILE PATH,FROM
  131. IniWrite,[DISABLED],Config.ini,FILE PATH,TO
  132. IniWrite,0,Config.ini,FILE PATH,AutoMove
  133. If (SRD="MANY")
  134. {
  135. IfNotExist,MultiPath.txt
  136. {
  137. FileAppend,,MultiPath.txt
  138. MsgBox,64,Message, Please Enter the list of paths to be deleted in "MultiPath.txt".
  139. ExitApp
  140. }
  141. else
  142. {
  143. Loop,read,MultiPath.txt
  144. {
  145. Loop,parse,A_LoopReadLine,`n
  146. {
  147. IfNotExist,% A_Loopfield
  148. {
  149. MsgBox, 16, AutoDelete Many, File Path Not Found!!!`n`n%A_Loopfield%, 5
  150. ExitApp
  151. }
  152. FileRemoveDir,%A_LoopField%,1
  153. If (errorlevel=1)
  154. {
  155. FileDelete,%A_LoopField%
  156. If (errorlevel)
  157. {
  158. MsgBox,16,AutoDelete Error, Please specify the correct filename and location!,5
  159. }
  160. }
  161. }
  162. }
  163. ExitApp
  164. }
  165. }
  166. else
  167. {
  168. IniWrite,[DISABLED],Config.ini,FILE PATH,TO
  169. IniWrite,0,Config.ini,FILE PATH,AutoMove
  170. FileRemoveDir,%SRD%,1
  171. If (errorlevel=1)
  172. {
  173. FileDelete,%SRD%
  174. If (errorlevel)
  175. {
  176. IniWrite,[Input Filename and location here],Config.ini,FILE PATH,FROM
  177. MsgBox,16,AutoDelete Error, Please specify the correct filename and location!,5
  178. }
  179. }
  180. ExitApp
  181. }
  182. }
  183. Else if (AutoD==2)
  184. {
  185. Iniread,SRDAll,Config.ini,FILE PATH,FROM
  186. IniWrite,[DISABLED],Config.ini,FILE PATH,TO
  187. IniWrite,0,Config.ini,FILE PATH,AutoMove
  188. IniWrite,0,Config.ini,FILE PATH,AutoCopy
  189. If (SRDAll="MANY")
  190. {
  191. IfNotExist,MultiPath.txt
  192. {
  193. FileAppend,,MultiPath.txt
  194. MsgBox,64,Message, Please Enter the list of paths to be deleted in "MultiPath.txt".
  195. ExitApp
  196. }
  197. else
  198. {
  199. Loop,read,MultiPath.txt
  200. {
  201. Loop,parse,A_LoopReadLine,`n
  202. {
  203. IfNotExist,% A_Loopfield
  204. {
  205. MsgBox, 16, AutoDelete Many, File Path Not Found!!!`n`n%A_Loopfield%, 5
  206. ExitApp
  207. }
  208. Loop,%A_LoopField%\*.*,1
  209. {
  210. FileRemoveDir,%A_LoopField%\%A_LoopFileName%,1
  211. }
  212. }
  213. }
  214. }
  215. ExitApp
  216. }
  217.  
  218.  
  219.  
  220.  
  221. else
  222. {
  223. Loop,%SRDAll%\*.*,1
  224. {
  225. FileRemoveDir,%SRDAll%\%A_LoopFileName%,1
  226. if (errorlevel=1)
  227. {
  228. FileDelete,%SRDAll%\%A_LoopFileName%
  229. if (errorlevel=1)
  230. {
  231. IniWrite,[Input Filename and location here],Config.ini,FILE PATH,FROM
  232. MsgBox,16,AutoDelete Error, Please specify the correct filename and location!,5
  233. }
  234. }
  235. }
  236. ExitApp
  237. }
  238. }
  239. else if(AutoD="ERROR") or (AutoD="")
  240. {
  241. IniWrite,0,Config.ini,FILE PATH,AutoDelete
  242. Goto, AutoMM
  243.  
  244. }
  245. else if (AutoD==0)
  246. {
  247. Goto, AutoMM
  248. }
  249. else
  250. {
  251. IniWrite,0,Config.ini,FILE PATH,AutoDelete
  252. MsgBox,48,AutoDelete Warning, Please Enable one Settings using " 1 or 0 " ONLY.
  253. ExitApp
  254. }
  255. return
  256.  
  257. AutoMM:
  258. Iniread,AutoM,Config.ini,FILE PATH,AutoMove
  259.  
  260. If (AutoM==1)
  261. {
  262. IniWrite,0,Config.ini,FILE PATH,AutoDelete
  263. IniWrite,0,Config.ini,FILE PATH,AutoCopy
  264. IniRead,SRM,Config.ini,FILE PATH,FROM
  265. IniRead,SRM1,Config.ini,FILE PATH,TO
  266. FileMoveDir,%SRM%,%SRM1%,2
  267. If (Errorlevel=1)
  268. {
  269. IfExist, %SRM%
  270. {
  271. ifExist,%SRM1%
  272. {
  273. FileMove,%SRM%,%SRM1%,1
  274. If (errorlevel)
  275. {
  276. IniWrite,[Edit This],Config.ini,FILE PATH,FROM
  277. IniWrite,[Edit This],Config.ini,FILE PATH,TO
  278. MsgBox,16,AutoMove Error, Please specify the correct filename and location!,5
  279. ExitApp
  280. }
  281. ExitApp
  282. }
  283. else
  284. {
  285. IniWrite,[Edit This],Config.ini,FILE PATH,FROM
  286. IniWrite,[Edit This],Config.ini,FILE PATH,TO
  287. MsgBox,16,AutoMove Error, Please specify the correct filename and location!,5
  288. ExitApp
  289. }
  290. }
  291. else
  292. {
  293. IniWrite,[Edit This],Config.ini,FILE PATH,FROM
  294. IniWrite,[Edit This],Config.ini,FILE PATH,TO
  295. MsgBox,16,AutoMove Error, Please specify the correct filename and location!,5
  296. ExitApp
  297. }
  298.  
  299. }
  300. }
  301. Else if (AutoM==2)
  302. {
  303. Iniread,SRMAll,Config.ini,FILE PATH,FROM
  304. Iniread,DTMAll,Config.ini,FILE PATH,TO
  305. IniWrite,0,Config.ini,FILE PATH,AutoDelete
  306. IniWrite,0,Config.ini,FILE PATH,AutoCopy
  307. Loop,%SRMAll%\*.*,1
  308. {
  309. FileMoveDir,%SRMAll%\%A_LoopFileName%,%DTMAll%\%A_LoopFileName%,2
  310. if (errorlevel=1)
  311. {
  312. FileMove,%SRMAll%\%A_LoopFileName%,%DTMAll%\%A_LoopFileName%,1
  313. if (errorlevel=1)
  314. {
  315. IniWrite,[Edit This],Config.ini,FILE PATH,FROM
  316. IniWrite,[Edit This],Config.ini,FILE PATH,TO
  317. MsgBox,16,AutoMove Error, Please specify the correct filename and location!,5
  318. ExitApp
  319. }
  320. }
  321. }
  322. ExitApp
  323. }
  324. Else if(AutoM="ERROR") or (AutoM="")
  325. {
  326. IniWrite,0,Config.ini,FILE PATH,AutoMove
  327. MsgBox,48,AutoMove Warning, Please Enable one Settings using " 1 or 0 " ONLY.,10
  328. ExitApp
  329. }
  330. Else if (AutoM==0)
  331. {
  332. MsgBox,32,AutoCDM Message, Nothing is Enabled.,10
  333. ExitApp
  334. }
  335. else
  336. {
  337. IniWrite,0,Config.ini,FILE PATH,AutoMove
  338. MsgBox,48,AutoMove Warning, Please Enable one Settings using " 1 or 0 " ONLY.,10
  339. ExitApp
  340. }
  341.  
  342.  
  343. return
  344.  
  345. MultiPath:
  346. Loop,read, MultiPath.txt
  347. {
  348. Loop,parse,A_LoopReadLine,`n`r%A_Space%%A_Tab%
  349. {
  350. Fileread,MTPATHS,%A_LoopField%
  351.  
  352. }
  353. }
  354. return
  355.  
  356. Esc::
  357. ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement