Jump to content
khidotdn

Help me Error error: missing EndSwitch.

Recommended Posts

khidotdn

>"C:\Program Files (x86)\AutoIt3\SciTE\..\au3check.exe" -q "C:\Users\iCafe8\Desktop\12.au3"
"C:\Users\iCafe8\Desktop\12.au3"(1557,1) :

;--------------------------------------------------------------------------------------------------------------------------------------
While 1
    $MSG = GUIGetMsg()
Switch $MSG




;--------------------
    Case $opt
   #RequireAdmin
   RunWait('"'&@ComSpec&'" /c REG ADD HKEY_CURRENT_USER\Software\Optimize /v Optimize /t REG_DWORD /d 0x00000000 /f', "", @SystemDir,@SW_HIDE)
SplashTextOn("Thông báo", "Đang tiến hành....", 400, 55, -1, -1, 1, "Times New Roman", 24)
DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
;------------Services Win 7
If @OSVersion = "WIN_7" Then
;------------Disable Firewall
    RunWait('"'&@ComSpec&'" /c NetSh Advfirewall set allprofiles state off',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c net stop MpsSvc',@SystemDir,@SW_HIDE)
;------------Fix CF
    RunWait('"'&@ComSpec&'" /c bcdedit /set increaseUserVa 3072',@SystemDir,@SW_HIDE)
;------------Desktop Window Manager Session Manager
    RunWait('"'&@ComSpec&'" /c sc config "UxSms" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "UxSms"',@SystemDir,@SW_HIDE)
;------------Program Compatibility Assistant Service
    RunWait('"'&@ComSpec&'" /c sc config "PcaSvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "PcaSvc"',@SystemDir,@SW_HIDE)
;------------------WinHTTP Web Proxy Auto-Discovery Service
    RunWait('"'&@ComSpec&'" /c sc config "WinHttpAutoProxySvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "WinHttpAutoProxySvc"',@SystemDir,@SW_HIDE)
;------------------Superfetch
    RunWait('"'&@ComSpec&'" /c sc config "SysMain" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "SysMain"',@SystemDir,@SW_HIDE)
;------------------Windows Search
    RunWait('"'&@ComSpec&'" /c sc config "WSearch" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "WSearch"',@SystemDir,@SW_HIDE)
;------------------Windows Defender Service
    RunWait('"'&@ComSpec&'" /c sc config "WinDefend" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "WinDefend"',@SystemDir,@SW_HIDE)
;------------------Disk Defragmenter
    RunWait('"'&@ComSpec&'" /c sc config "defragsvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "defragsvc"',@SystemDir,@SW_HIDE)
;------------------TabletInputService
    RunWait('"'&@ComSpec&'" /c sc config "TabletInputService" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "TabletInputService"',@SystemDir,@SW_HIDE)
;------------------WLAN AutoConfig
    RunWait('"'&@ComSpec&'" /c sc config "Wlansvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "Wlansvc"',@SystemDir,@SW_HIDE)
;------------------Bluetooth Support Service
    RunWait('"'&@ComSpec&'" /c sc config "bthserv" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "bthserv"',@SystemDir,@SW_HIDE)
;------------------Bluetooth Handsfree Service
    RunWait('"'&@ComSpec&'" /c sc config "BthHFSrv" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "BthHFSrv"',@SystemDir,@SW_HIDE)
;--------------------------------
;------------Services Win 7x64
If @OSArch = "X64" Then
If @OSVersion = "WIN_7" Then
;------------AMD FUEL Service
    RunWait('"'&@ComSpec&'" /c sc config "AMD FUEL Service" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "AMD FUEL Service"',@SystemDir,@SW_HIDE)
;------------Skype Updater
    RunWait('"'&@ComSpec&'" /c sc config "SkypeUpdate" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "SkypeUpdate"',@SystemDir,@SW_HIDE)
;------------Skype Click to Call Updater
    RunWait('"'&@ComSpec&'" /c sc config "c2cautoupdatesvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "c2cautoupdatesvc"',@SystemDir,@SW_HIDE)
;------------Skype Click to Call PNR Service
    RunWait('"'&@ComSpec&'" /c sc config "c2cpnrsvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "c2cpnrsvc"',@SystemDir,@SW_HIDE)
;------------Disable Firewall
    RunWait('"'&@ComSpec&'" /c NetSh Advfirewall set allprofiles state off',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c net stop MpsSvc',@SystemDir,@SW_HIDE)
;------------Fix CF
    RunWait('"'&@ComSpec&'" /c bcdedit /set increaseUserVa 3072',@SystemDir,@SW_HIDE)
;------------Desktop Window Manager Session Manager
    RunWait('"'&@ComSpec&'" /c sc config "UxSms" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "UxSms"',@SystemDir,@SW_HIDE)
;------------Program Compatibility Assistant Service
    RunWait('"'&@ComSpec&'" /c sc config "PcaSvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "PcaSvc"',@SystemDir,@SW_HIDE)
;------------------WinHTTP Web Proxy Auto-Discovery Service
    RunWait('"'&@ComSpec&'" /c sc config "WinHttpAutoProxySvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "WinHttpAutoProxySvc"',@SystemDir,@SW_HIDE)
;------------------Superfetch
    RunWait('"'&@ComSpec&'" /c sc config "SysMain" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "SysMain"',@SystemDir,@SW_HIDE)
;------------------Windows Search
    RunWait('"'&@ComSpec&'" /c sc config "WSearch" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "WSearch"',@SystemDir,@SW_HIDE)
;------------------Windows Defender Service
    RunWait('"'&@ComSpec&'" /c sc config "WinDefend" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "WinDefend"',@SystemDir,@SW_HIDE)
;------------------Disk Defragmenter
    RunWait('"'&@ComSpec&'" /c sc config "defragsvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "defragsvc"',@SystemDir,@SW_HIDE)
;------------------TabletInputService
    RunWait('"'&@ComSpec&'" /c sc config "TabletInputService" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "TabletInputService"',@SystemDir,@SW_HIDE)
;------------------WLAN AutoConfig
    RunWait('"'&@ComSpec&'" /c sc config "Wlansvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "Wlansvc"',@SystemDir,@SW_HIDE)
;------------------Bluetooth Support Service
    RunWait('"'&@ComSpec&'" /c sc config "bthserv" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "bthserv"',@SystemDir,@SW_HIDE)
;------------------Bluetooth Handsfree Service
    RunWait('"'&@ComSpec&'" /c sc config "BthHFSrv" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "BthHFSrv"',@SystemDir,@SW_HIDE)
    EndIf
;-----------------------------Problem reporting setings Win 7
Local $sRegKey = "\Software\Microsoft\Windows\Windows Error Reporting"
If @OSArch = "X64" Then
    $sRegKey = "HKCU64" & $sRegKey
Else
    $sRegKey = "HKCU" & $sRegKey
EndIf
RegWrite($sRegKey, "Disabled", "REG_DWORD", "1")
RegWrite($sRegKey, "DontShowUI", "REG_DWORD", "1")
;-----------------------------ComputerRestore Win 7
Local $sRegKey = "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore"
If @OSArch = "X64" Then
    $sRegKey = "HKLM64" & $sRegKey
Else
    $sRegKey = "HKLM" & $sRegKey
EndIf
RegWrite($sRegKey, "RPSessionInterval", "REG_DWORD", "0")
EndIf
;------------Services Win XP
If @OSVersion = "WIN_XP" Then
;------------Security Center XP
    RunWait('"'&@ComSpec&'" /c sc config "wscsvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "wscsvc"',@SystemDir,@SW_HIDE)
;------------QoS RSVP
    RunWait('"'&@ComSpec&'" /c sc config "RSVP" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "RSVP"',@SystemDir,@SW_HIDE)
;------------------System Restore Service XP
    RunWait('"'&@ComSpec&'" /c sc config "srservice" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "srservice"',@SystemDir,@SW_HIDE)
;------------------Wireless Zero Configuration
    RunWait('"'&@ComSpec&'" /c sc config "WZCSVC" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "WZCSVC"',@SystemDir,@SW_HIDE)
;-----------------------------Problem reporting setings XP
Local $sRegKey = "\SOFTWARE\Microsoft\PCHealth\ErrorReporting"
      $sRegKey = "HKLM" & $sRegKey
RegWrite($sRegKey, "DoReport", "REG_DWORD", "0")
RegWrite($sRegKey, "ShowUI", "REG_DWORD", "0")
;-----------------------------ComputerRestore Win XP
Local $sRegKey = "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore"
      $sRegKey = "HKLM" & $sRegKey
RegWrite($sRegKey, "DisableSR", "REG_DWORD", "0")

;-----------------------------ComputerRestore Win XP
Local $sRegKey = "\SYSTEM\CurrentControlSet\Control\CrashControl"
      $sRegKey = "HKLM" & $sRegKey
RegWrite($sRegKey, "SendAlert", "REG_DWORD", "0")
  EndIf
EndIf
;------------Services Win XP & WIN 7
;------------AMD FUEL Service
    RunWait('"'&@ComSpec&'" /c sc config "AMD FUEL Service" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "AMD FUEL Service"',@SystemDir,@SW_HIDE)
;------------Skype Updater
    RunWait('"'&@ComSpec&'" /c sc config "SkypeUpdate" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "SkypeUpdate"',@SystemDir,@SW_HIDE)
;------------Skype Click to Call Updater
    RunWait('"'&@ComSpec&'" /c sc config "c2cautoupdatesvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "c2cautoupdatesvc"',@SystemDir,@SW_HIDE)
;------------Skype Click to Call PNR Service
    RunWait('"'&@ComSpec&'" /c sc config "c2cpnrsvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "c2cpnrsvc"',@SystemDir,@SW_HIDE)
;------------Disable Hibernate
    RunWait('"'&@ComSpec&'" /c powercfg -h off',@SystemDir,@SW_HIDE)
    ;------------------Nvidia Geforce Experience
    RunWait('"'&@ComSpec&'" /c sc config "ShadowPlay" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "ShadowPlay"',@SystemDir,@SW_HIDE)
;------------------Windows Update
    RunWait('"'&@ComSpec&'" /c sc config "wuauserv" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "wuauserv"',@SystemDir,@SW_HIDE)
;-------------AMD External Events Utility
    RunWait('"'&@ComSpec&'" /c sc config "AMD External Events Utility" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "AMD External Events Utility"',@SystemDir,@SW_HIDE)
;------------------AMD FUEL Service
    RunWait('"'&@ComSpec&'" /c sc config "AMD FUEL Service" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "AMD FUEL Service"',@SystemDir,@SW_HIDE)
;------------------amdacpusrsvc
    RunWait('"'&@ComSpec&'" /c sc config "amdacpusrsvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "amdacpusrsvc"',@SystemDir,@SW_HIDE)
;------------------NVIDIA Driver Helper Service
    RunWait('"'&@ComSpec&'" /c sc config "NVSvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "NVSvc"',@SystemDir,@SW_HIDE)
;------------------NvNetworkService
    RunWait('"'&@ComSpec&'" /c sc config "NvNetworkService" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "NvNetworkService"',@SystemDir,@SW_HIDE)
;------------------GfExperienceService
    RunWait('"'&@ComSpec&'" /c sc config "GfExperienceService" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "GfExperienceService"',@SystemDir,@SW_HIDE)
;------------------NvStreamSvc
    RunWait('"'&@ComSpec&'" /c sc config "NvStreamSvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "NvStreamSvc"',@SystemDir,@SW_HIDE)
;------------------WajaIntEn Monitor
    RunWait('"'&@ComSpec&'" /c sc config "WajaIntEn Monitor" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "WajaIntEn Monitor"',@SystemDir,@SW_HIDE)
;------------------PnkBstrA
    RunWait('"'&@ComSpec&'" /c sc config "PnkBstrA" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "PnkBstrA"',@SystemDir,@SW_HIDE)
;------------------AMD External Events Utility
    RunWait('"'&@ComSpec&'" /c sc config "AMD External Events Utility" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "AMD External Events Utility"',@SystemDir,@SW_HIDE)
;------------------odserv
    RunWait('"'&@ComSpec&'" /c sc config "odserv" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "odserv"',@SystemDir,@SW_HIDE)
;------------------Mozilla Maintenance
    RunWait('"'&@ComSpec&'" /c sc config "MozillaMaintenance" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "MozillaMaintenance"',@SystemDir,@SW_HIDE)
;------------------Stereo Service
    RunWait('"'&@ComSpec&'" /c sc config "Stereo Service" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "Stereo Service"',@SystemDir,@SW_HIDE)
;------------------Intel(R) HD Graphics Control Panel Service
    RunWait('"'&@ComSpec&'" /c sc config "igfxCUIService1.0.0.0" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "igfxCUIService1.0.0.0"',@SystemDir,@SW_HIDE)
;------------------Stereo Service
    RunWait('"'&@ComSpec&'" /c sc config "ICCS" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "ICCS"',@SystemDir,@SW_HIDE)
;------------------Intel(R) Content Protection HECI Service
    RunWait('"'&@ComSpec&'" /c sc config "cphs" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "cphs"',@SystemDir,@SW_HIDE)
;------------------Local Session Manager
    RunWait('"'&@ComSpec&'" /c sc config "LMS" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "LMS"',@SystemDir,@SW_HIDE)
;------------------Intel(R) Capability Licensing Service TCP IP Interface
    RunWait('"'&@ComSpec&'" /c sc config "Intel(R) Capability Licensing Service TCP IP Interface" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "Intel(R) Capability Licensing Service TCP IP Interface"',@SystemDir,@SW_HIDE)
;------------------Intel(R) Capability Licensing Service Interface
    RunWait('"'&@ComSpec&'" /c sc config "Intel(R) Capability Licensing Service Interface" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "Intel(R) Capability Licensing Service Interface"',@SystemDir,@SW_HIDE)
;------------------Google Update Service (gupdate)
    RunWait('"'&@ComSpec&'" /c sc config "gupdate" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "gupdate"',@SystemDir,@SW_HIDE)
;------------------Google Update Service (gupdatem)
    RunWait('"'&@ComSpec&'" /c sc config "gupdatem" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "gupdatem"',@SystemDir,@SW_HIDE)
;------------------Computer Browser
    RunWait('"'&@ComSpec&'" /c sc config "Browser" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "Browser"',@SystemDir,@SW_HIDE)
;------------------UPnP Device Host
    RunWait('"'&@ComSpec&'" /c sc config "upnphost" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "upnphost"',@SystemDir,@SW_HIDE)
;------------------Delete file in Task Scheduler
    RunWait('"'&@ComSpec&'" /c sc config "Schedule" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "Schedule"',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c schtasks /delete /tn * /f',@SystemDir,@SW_HIDE)
;------------------Internet Connection Sharing (ICS)
    RunWait('"'&@ComSpec&'" /c sc config "SharedAccess" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "SharedAccess"',@SystemDir,@SW_HIDE)
;------------------NVIDIA Update Service Daemon
    RunWait('"'&@ComSpec&'" /c sc config "nvUpdatusService" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "nvUpdatusService"',@SystemDir,@SW_HIDE)
;------------------Office Source Engine
    RunWait('"'&@ComSpec&'" /c sc config "ose" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "ose"',@SystemDir,@SW_HIDE)
;------------------VIA Karaoke digital mixer Service
    RunWait('"'&@ComSpec&'" /c sc config "VIAKaraokeService" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "VIAKaraokeService"',@SystemDir,@SW_HIDE)
;------------------ASUS Com Service
    RunWait('"'&@ComSpec&'" /c sc config "asComSvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "asComSvc"',@SystemDir,@SW_HIDE)
;------------------DHCP Com Service
    RunWait('"'&@ComSpec&'" /c sc config Dhcp start= auto',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c net start Dhcp',@SystemDir,@SW_HIDE)
;----------------System failaure
    RunWait('"'&@ComSpec&'" /c wmic recoveros set AutoReboot = False',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c wmic recoveros set WriteToSystemLog = False',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c wmic recoveros set DebugInfoType = 0',@SystemDir,@SW_HIDE)

 If @OSArch = "X64" Then
    RunWait('"'&@ComSpec&'" /c powercfg -h off',@SystemDir,@SW_HIDE)
;------------------Windows Update
    RunWait('"'&@ComSpec&'" /c sc config "wuauserv" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "wuauserv"',@SystemDir,@SW_HIDE)
;-------------AMD External Events Utility
    RunWait('"'&@ComSpec&'" /c sc config "AMD External Events Utility" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "AMD External Events Utility"',@SystemDir,@SW_HIDE)
;------------------AMD FUEL Service
    RunWait('"'&@ComSpec&'" /c sc config "AMD FUEL Service" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "AMD FUEL Service"',@SystemDir,@SW_HIDE)
;------------------amdacpusrsvc
    RunWait('"'&@ComSpec&'" /c sc config "amdacpusrsvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "amdacpusrsvc"',@SystemDir,@SW_HIDE)
;------------------NVIDIA Driver Helper Service
    RunWait('"'&@ComSpec&'" /c sc config "NVSvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "NVSvc"',@SystemDir,@SW_HIDE)
;------------------NvNetworkService
    RunWait('"'&@ComSpec&'" /c sc config "NvNetworkService" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "NvNetworkService"',@SystemDir,@SW_HIDE)
;------------------GfExperienceService
    RunWait('"'&@ComSpec&'" /c sc config "GfExperienceService" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "GfExperienceService"',@SystemDir,@SW_HIDE)
;------------------NvStreamSvc
    RunWait('"'&@ComSpec&'" /c sc config "NvStreamSvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "NvStreamSvc"',@SystemDir,@SW_HIDE)
;------------------WajaIntEn Monitor
    RunWait('"'&@ComSpec&'" /c sc config "WajaIntEn Monitor" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "WajaIntEn Monitor"',@SystemDir,@SW_HIDE)
;------------------PnkBstrA
    RunWait('"'&@ComSpec&'" /c sc config "PnkBstrA" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "PnkBstrA"',@SystemDir,@SW_HIDE)
;------------------AMD External Events Utility
    RunWait('"'&@ComSpec&'" /c sc config "AMD External Events Utility" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "AMD External Events Utility"',@SystemDir,@SW_HIDE)
;------------------odserv
    RunWait('"'&@ComSpec&'" /c sc config "odserv" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "odserv"',@SystemDir,@SW_HIDE)
;------------------Mozilla Maintenance
    RunWait('"'&@ComSpec&'" /c sc config "MozillaMaintenance" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "MozillaMaintenance"',@SystemDir,@SW_HIDE)
;------------------Stereo Service
    RunWait('"'&@ComSpec&'" /c sc config "Stereo Service" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "Stereo Service"',@SystemDir,@SW_HIDE)
;------------------Intel(R) HD Graphics Control Panel Service
    RunWait('"'&@ComSpec&'" /c sc config "igfxCUIService1.0.0.0" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "igfxCUIService1.0.0.0"',@SystemDir,@SW_HIDE)
;------------------Stereo Service
    RunWait('"'&@ComSpec&'" /c sc config "ICCS" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "ICCS"',@SystemDir,@SW_HIDE)
;------------------Intel(R) Content Protection HECI Service
    RunWait('"'&@ComSpec&'" /c sc config "cphs" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "cphs"',@SystemDir,@SW_HIDE)
;------------------Local Session Manager
    RunWait('"'&@ComSpec&'" /c sc config "LMS" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "LMS"',@SystemDir,@SW_HIDE)
;------------------Intel(R) Capability Licensing Service TCP IP Interface
    RunWait('"'&@ComSpec&'" /c sc config "Intel(R) Capability Licensing Service TCP IP Interface" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "Intel(R) Capability Licensing Service TCP IP Interface"',@SystemDir,@SW_HIDE)
;------------------Intel(R) Capability Licensing Service Interface
    RunWait('"'&@ComSpec&'" /c sc config "Intel(R) Capability Licensing Service Interface" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "Intel(R) Capability Licensing Service Interface"',@SystemDir,@SW_HIDE)
;------------------Google Update Service (gupdate)
    RunWait('"'&@ComSpec&'" /c sc config "gupdate" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "gupdate"',@SystemDir,@SW_HIDE)
;------------------Google Update Service (gupdatem)
    RunWait('"'&@ComSpec&'" /c sc config "gupdatem" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "gupdatem"',@SystemDir,@SW_HIDE)
;------------------Computer Browser
    RunWait('"'&@ComSpec&'" /c sc config "Browser" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "Browser"',@SystemDir,@SW_HIDE)
;------------------UPnP Device Host
    RunWait('"'&@ComSpec&'" /c sc config "upnphost" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "upnphost"',@SystemDir,@SW_HIDE)
;------------------Delete file in Task Scheduler
    RunWait('"'&@ComSpec&'" /c sc config "Schedule" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "Schedule"',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c schtasks /delete /tn * /f',@SystemDir,@SW_HIDE)
;------------------Internet Connection Sharing (ICS)
    RunWait('"'&@ComSpec&'" /c sc config "SharedAccess" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "SharedAccess"',@SystemDir,@SW_HIDE)
;------------------NVIDIA Update Service Daemon
    RunWait('"'&@ComSpec&'" /c sc config "nvUpdatusService" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "nvUpdatusService"',@SystemDir,@SW_HIDE)
;------------------Office Source Engine
    RunWait('"'&@ComSpec&'" /c sc config "ose" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "ose"',@SystemDir,@SW_HIDE)
;------------------VIA Karaoke digital mixer Service
    RunWait('"'&@ComSpec&'" /c sc config "VIAKaraokeService" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "VIAKaraokeService"',@SystemDir,@SW_HIDE)
;------------------ASUS Com Service
    RunWait('"'&@ComSpec&'" /c sc config "asComSvc" start= Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "asComSvc"',@SystemDir,@SW_HIDE)
;------------------DHCP Com Service
    RunWait('"'&@ComSpec&'" /c sc config Dhcp start= auto',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c net start Dhcp',@SystemDir,@SW_HIDE)
;----------------System failaure
    RunWait('"'&@ComSpec&'" /c wmic recoveros set AutoReboot = False',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c wmic recoveros set WriteToSystemLog = False',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c wmic recoveros set DebugInfoType = 0',@SystemDir,@SW_HIDE)
EndIf
;-----------------------------VisualEffects
Local $sRegKey = "\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects"
If @OSArch = "X64" Then
    $sRegKey = "HKCU64" & $sRegKey
Else
    $sRegKey = "HKCU" & $sRegKey
EndIf
RegWrite($sRegKey, "VisualFXSetting", "REG_DWORD", "2")
;-----------------------------PagingFiles
$iFileGetSize = Round(FileGetSize( "C:\pagefile.sys" )/1048576,2)  ;Returns file size in bytes
$Free = Round(DriveSpaceFree( "c:\" ),2) ;Returns Free space in MB
$Used = Round($Free + $iFileGetSize,2)
If $Used > 5110 Then
EndIf
If $Used < 5110 Then
    MsgBox(0, "Cảnh báo", "Dung lượng còn trống của ổ C sẽ thấp hơn 1Gb sau khi set pagefile")
    EndIf
If $Used < 4296 Then
    MsgBox(0, "", "Lỗi set Pagingfile ! Dung lượng trống của ổ C không đủ")
    EndIf
Local $sRegKey = "\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management"
If @OSArch = "X64" Then
    $sRegKey = "HKLM64" & $sRegKey
Else
    $sRegKey = "HKLM" & $sRegKey

EndIf
RegWrite($sRegKey, "PagingFiles", "REG_MULTI_SZ", "C:\pagefile.sys 4096 4096")

;-----------------------------UAC
Local $sRegKey = "\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
If @OSArch = "X64" Then
    $sRegKey = "HKLM64" & $sRegKey
Else
    $sRegKey = "HKLM" & $sRegKey

EndIf
RegWrite($sRegKey, "EnableLUA", "REG_DWORD", "0")

;-----------------------------Task Scheduler
Local $sRegKey = "\SYSTEM\CurrentControlSet\services\Schedule"
If @OSArch = "X64" Then
    $sRegKey = "HKLM64" & $sRegKey
Else
    $sRegKey = "HKLM" & $sRegKey

EndIf
RegWrite($sRegKey, "Start", "REG_DWORD", "4")


;-----------------------------Msconfig

    $aRegKeys[0] = "IMJPMIG"
    $aRegKeys[1] = "CocCoc Update"
    $aRegKeys[2] = "Intel(R) Common User Interface"
    $aRegKeys[3] = "Java Platform SE Auto Updater"
    $aRegKeys[4] = "IgfxTray"
    $aRegKeys[5] = "HotKeysCmds"
    $aRegKeys[6] = "Vmware User process"
    $aRegKeys[7] = "ImScInst"
    $aRegKeys[8] = "hkcmd"
    $aRegKeys[9] = "igfxpers"
    $aRegKeys[10] = "StartCCC"
    $aRegKeys[11] = "USB3MON"
    $aRegKeys[12] = "CuHanhPlay"
    $aRegKeys[13] = "SynTPEnh"
    $aRegKeys[14] = "Quicktime Task"
    $aRegKeys[15] = "iTunesHelper"
    $aRegKeys[16] = "NvBackend"
    $aRegKeys[17] = "NvMctray"
    $aRegKeys[18] = "Persistence"
    $aRegKeys[19] = "SunJavaUpdateSched"
    $aRegKeys[20] = "ctfmon.exe"
    $aRegKeys[21] = "NvCpl"
    $aRegKeys[22] = "TINTSETP"
    $aRegKeys[23] = "jusched"
    $aRegKeys[24] = "CocCoc"
    $aRegKeys[25] = "IMEKRMIG"
    $aRegKeys[26] = "CCleaner Monitoring"
    $aRegKeys[27] = "Google Update"
    $aRegKeys[28] = "ShadowPlay"
    $aRegKeys[29] = "AppEx Accelerator UI"
    $aRegKeys[30] = "StartCN"
    $aRegKeys[31] = "Raptr"
    $aRegKeys[32] = "Messenger (Yahoo!)"


    ; Loop to delete startup registry keys
        For $g = 0 To UBound($aRegKeys) - 1
        RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $aRegKeys[$g])
        RegRead("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $aRegKeys[$g])
        RegRead("HKLM64\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run", $aRegKeys[$g])
        If @error <> 0 Then
            ; do nothing
        Else
            For $r = 0 To UBound($aRegKeys) - 1
                RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $aRegKeys[$r])
                RegDelete("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $aRegKeys[$r])
                RegDelete("HKLM64\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run", $aRegKeys[$r])
                Sleep(100)
            Next
        EndIf
     Next
         ; Loop to delete startup registry keys
    For $g = 0 To UBound($aRegKeys) - 1
        RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", $aRegKeys[$g])
        RegRead("HKCU64\Software\Microsoft\Windows\CurrentVersion\Run", $aRegKeys[$g])
        If @error <> 0 Then
            ; do nothing
        Else
            For $r = 0 To UBound($aRegKeys) - 1
                RegDelete("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", $aRegKeys[$r])
                RegDelete("HKCU64\Software\Microsoft\Windows\CurrentVersion\Run", $aRegKeys[$r])
                Sleep(100)
            Next
        EndIf
     Next
     SplashOff()
 MsgBox(0, "Thông báo", "Hoàn thành ! Bạn cần khởi động lại máy tính")
;--------------
Case $vnc
    SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
 $sFilePath = @DesktopDir & "\VNC-32bit.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/VNC-32bit.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
    ;-----------------------------
Case $KVRT
    SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
 $sFilePath = @DesktopDir & "\KVRT.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/KVRT.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
;---------------------------
Case $ftppro
    SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
 $sFilePath = @DesktopDir & "\FTPToolPro.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/FTPToolPro.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
;--------------------------------
Case $sql
       SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
 $sFilePath = @TempDir & "\ResetMySql.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/ResetMySql.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)

MsgBox(0, "Thông báo", "Reset password MySQL hoàn thành, password là: 1")
;----------------------------------
Case $rpfirewall
       SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
       $sFilePath = @TempDir & "\RepaiWindowsFirewall.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/RepaiWindowsFirewall.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)

SplashOff()
;------------------------------------------
Case $drbter
    SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
    $sFilePath = @DesktopDir & "\DriverBoosterPRO2.rar"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/DriverBoosterPRO2.rar", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
 SplashOff()
;----------------------------------
    Case $pnp
 SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
 $sFilePath = @DesktopDir & "\CSMBootPnP.rar"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/CSMBootPnP.rar", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)

SplashOff()
Case $HDTune
        SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
$sFilePath = @MyDocumentsDir & "\HDTunePro.rar"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/HDTunePro.rar", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
 SplashOff()
;---------------------------

 ;--------------- Device Manager----------
 Case $driver
    Run(@ComSpec & " /c " & 'devmgmt.msc', "", @SW_HIDE)
 ;----------------Check Disk-------------
 Case $msconfig
#requireadmin
DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
ShellExecute('msconfig.exe', -4) ; << 4 = which tab to display
DllCall("kernel32.dll", "int", "Wow64EnableWow64FsRedirection", "int", 1)
RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MSConfig") ; << stops the message after reboot
    ;-------3DP Chip
 Case $chip
SplashTextOn("", "Xin vui lòng đợi....", 400, 55, -1, -1, 1,  "Times New Roman", 24)
 $sFilePath = @DesktopDir & "\3DPChip.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/3DPChip.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)

SplashOff()

    ;--------Info hardware
 Case $hwinfo
SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
 $sFilePath = @DesktopDir & "\Speccy.exe"
   Local $hDownload = InetGet("https://2c5b41dfa27d75bca7b5f750bec99bd02455da06.googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/Speccy.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
SplashOff()

;------------------------
    Case $rmwin
 SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
  $sFilePath = @DesktopDir & "\RemoveWAT.zip"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/RemoveWAT.zip", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)

SplashOff()
;-----------------------------------------
    Case $cbui
       SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
 $sFilePath = @DesktopDir & "\CSMBoot_Setup.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/CSMBoot_Setup.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)

SplashOff()

;--------------------
Case $filezilla
SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
$sFilePath = @DesktopDir & "\FileZillaPortable.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/FileZillaPortable.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)

SplashOff()
;--------------------
Case $shutg
 SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
 $sFilePath = @MyDocumentsDir & "\ShutdownGcafe.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/ShutdownGcafe.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
SplashOff()
;--------------------------------------------
Case $fixie
   SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
    $sFilePath = @MyDocumentsDir & "\ResetEDefault.msi"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/ResetEDefault.ms", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
SplashOff()
;----------------------------------------
Case $sp5
   SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
If @OSVersion = "WIN_7" Then
   $sFilePath = @MyDocumentsDir & "\CSMBootClient2.0.0_sp5_Win7_32.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/CSMBootClient2.0.0_sp5_Win7_32.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
 EndIf
SplashOff()
If @OSVersion = "WIN_XP" Then
    $sFilePath = @MyDocumentsDir & "\CSMBootClient2.0.0_sp5_WinXP.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/CSMBootClient2.0.0_sp5_WinXP.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
 EndIf
SplashOff()
 If @OSArch = "X64" Then

    $sFilePath = @MyDocumentsDir & "\CSMBootClient2.0.0_sp5_Win7_64.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/CSMBootClient2.0.0_sp5_Win7_64.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)

 EndIf
 SplashOff()
 ;---------------
  Case $ime10
     SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
    RunWait('"'&@ComSpec&'" /c sc config "wuauserv" start= Auto',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc start "wuauserv"',@SystemDir,@SW_HIDE)
   $sFilePath = @TempDir & "\ME10.zip"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/ME10.zip", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
    SplashOff()
 Case $ime9
         SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
    RunWait('"'&@ComSpec&'" /c sc config "wuauserv" start= Auto',@SystemDir,@SW_HIDE)
  RunWait('"'&@ComSpec&'" /c sc start "wuauserv"',@SystemDir,@SW_HIDE)
$sFilePath = @TempDir & "\Mei9.zip"
 Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/Mei9.zip", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

 Do

    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
    SplashOff()
;-----------------
Case $iME
   SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
    RunWait('"'&@ComSpec&'" /c sc config "wuauserv" start= Auto',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc start "wuauserv"',@SystemDir,@SW_HIDE)
If @OSArch = "X64" Then
$sFilePath = @TempDir & "\Fix-x64.msu"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/Fix-x64.msu", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
 Else
    $sFilePath = @TempDir & "\Fix-x86.msu"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/Fix-x86.msu", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
SplashOff()
 EndIf
       ;--------------------
    Case $cbclient
 SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)

If @OSVersion = "WIN_7" Then
$sFilePath = @MyDocumentsDir & "\CSMBootClient_Setup_Win32.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/CSMBootClient_Setup_Win32.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
SplashOff()
 EndIf
If @OSVersion = "WIN_XP" Then
   $sFilePath = @MyDocumentsDir & "\CSMBootClient_Setup_WinXP.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/CSMBootClient_Setup_WinXP.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
SplashOff()
 EndIf

 If @OSArch = "X64" Then
     $sFilePath = @MyDocumentsDir & "\CSMBootClient_Setup_Win64.exe"
   Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/CSMBootClient_Setup_Win64.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
SplashOff()
 EndIf

       ;--------------------
    Case $aflash
RunWait('"'&@ComSpec&'" /c Taskkill /IM CyberStation.exe /F"',@SystemDir,@SW_HIDE)

SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
$sFilePath = @DesktopDir & "\flash21installer.exe"
    Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/flash21installer.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
SplashOff()
;-------------------------------------
Case $Bitvise
   SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
$sFilePath = @MyDocumentsDir & "\BvSshClient.exe"
    Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/BvSshClient.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
SplashOff()

;-------------------
Case $cline
   SplashTextOn("Thông báo", "Xin vui lòng đợi....", 400, 55, -1, -1, 1, "Times New Roman", 24)
$sFilePath = @MyDocumentsDir & "\changeline.exe"
    Local $hDownload = InetGet("https://googledrive.com/host/0B8kF-2k17yfIaEFpT2YzWHlRRms/changeline.exe", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

  Do
       Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
    Local $iFileSize = FileGetSize($sFilePath)
    InetClose($hDownload)
    ShellExecute($sFilePath)
SplashOff()
;------------------------------
Case $adriver
Do
    $pass = InputBox ("Nhập mật khẩu", "Vui lòng nhập mật khẩu","","*",150,130)
    If $pass <> "123456@" Then
        $msgbox = MsgBox (1,"Cảnh báo" , " Bạn muốn thử lại ?")
        If $msgbox = 2 Then
       ; MsgBox (0,"Thoát" , "Thoát chương trình.")
         Exit
        EndIf
    EndIf
Until $pass == "123456@"

#Region <Cấu hình>
    Global $Form_Chinh, $Form_Phu, $arr_Request
    Global $iUser = 'taiht'
    Global $iPass = '123456@'
    Global $iURL = 'http://dulieufree.com/dl/login'
#EndRegion

_GUI_ChonNhomDriver()

Func _GUI_ChonNhomDriver()
    #Region <Lấy source của trang sau khi login>
        $arr_Request = _Login()
        $Nhom_SP = StringRegExp($arr_Request[1], '(?s)\Qid="body-section1">\E(.*?)\Q<span>\E(.*?)(?:\Q"page_collapsible"\E|$)', 3)
        ;lưu ý về $Nhom_SP: phần tử chẵn sẽ chứa tên Nhóm (ví dụ DRIVER TỰ ĐỘNG, NVIDIA CHINA...), phần tử lẻ chứa list Driver ứng với Nhóm.
    #EndRegion

    $widthButton = 200
    $heightButton = 30
    $soluong_Button = UBound($Nhom_SP) / 2

    $Form_Chinh = GUICreate("Dữ liệu free", $widthButton + 10, 25 + ($heightButton + 5) * $soluong_Button, 100, 100, -1, 0x8)
    GUISetFont(11)
    GUICtrlCreateLabel("Chọn loại VGA", 5, 5, $widthButton, 20, 0x201)
    Local $Button_Nhom_SP[$soluong_Button]
    For $i = 0 To $soluong_Button - 1
        $Button_Nhom_SP[$i] = GUICtrlCreateButton($Nhom_SP[$i * 2], 5, 30 + $i * 32, $widthButton, $heightButton) ;nhân 2 vì lưu ý ở trên (Nhóm thuộc phần tử chẵn)
    Next
    GUISetState()

    While Sleep(20)
        $__nMsg = GUIGetMsg()
        Switch $__nMsg
        Case -3
          ; Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptFullPath & '" /restart') ; Restart script
                Exit
            Case $Button_Nhom_SP[0] To $Button_Nhom_SP[$soluong_Button - 1]
                $sttButton = $__nMsg - $Button_Nhom_SP[0]
                $listDirver = $Nhom_SP[$sttButton * 2 + 1] ;nhân 2 cộng 1 vì lưu ý đã ghi ở trên (listDriver thuộc phần tử lẻ)
                $posButton = _ControlGetPos($Button_Nhom_SP[$sttButton])
                _GUI_ListDrver($posButton, $listDirver)
        EndSwitch
    WEnd
EndFunc

Func _GUI_ListDrver($posGUI, $listDirver)
    $arrDriver_Name = StringRegExp($listDirver, '(?m)none\"\s?\>(.*?)$', 3)
    $arrDriver_SizeFile = StringRegExp($listDirver, '(?i)\d{1,5}\s?MB', 3)
    $soluong_Driver = UBound($arrDriver_Name)
    If UBound($arrDriver_SizeFile) <> $soluong_Driver Then ReDim $arrDriver_SizeFile[$soluong_Driver]

    #Region <Tính độ lớn của GUI>
        Local $lenString = 0
        For $m = 0 To $soluong_Driver - 1
            $__len = StringLen('  ' & $arrDriver_Name[$m] & '   (' & $arrDriver_SizeFile[$m] & ')')
            If $__len > $lenString Then $lenString = $__len
        Next
        $widthButton = $lenString * 5.5
        $heightButton = 30
    #EndRegion

    $Form_Phu = GUICreate("", $widthButton + 10, 10 + $soluong_Driver * ($heightButton + 2), $posGUI[0] + $posGUI[2] + 10, $posGUI[1], 0x80400000, -1, WinGetHandle(AutoItWinGetTitle()))
    Local $Button_Driver[$soluong_Driver]
    For $k = 0 To $soluong_Driver - 1
        $Button_Driver[$k] = GUICtrlCreateButton('  ' & $arrDriver_Name[$k] & '   (' & $arrDriver_SizeFile[$k] & ')', 5, 5 + $k * 32, $widthButton, $heightButton, 0x100 + 0x8000)
    Next
    GUISetState()

    While Sleep(20)
        If ControlGetFocus($Form_Chinh) Then ExitLoop GUIDelete($Form_Phu)
        $____nMsg = GUIGetMsg()
        Switch $____nMsg
            Case -3
                Exit
            Case $Button_Driver[0] To $Button_Driver[$soluong_Driver - 1]
                $sttButton = $____nMsg - $Button_Driver[0] ;đây cũng là số thứ tự của phần tử trong mảng $arrDriver_Name

                #Region <Logout và đăng nhập lại, tránh trường hợp bị refresh token>
                    $Logout_Request = _HttpRequest(1, 'http://dulieufree.com/dl/logout', '', $arr_Request[0], $iURL) ;logout phiên làm việc cũ
                    $arr_Request = _Login(_GetCookie($Logout_Request))
                #EndRegion

                $PageDownload = StringRegExp($arr_Request[1], 'href\s?=\s?\"(.*?)\".*?\Q' & $arrDriver_Name[$sttButton] & '\E', 1)[0]
                $Request = _HttpRequest(1, 'http://dulieufree.com' & $PageDownload, '', $arr_Request[0], $iURL, 'DNT: 1')
                $LinkDownload = StringRegExp($Request, '(?i)\QLocation: \E(.*)', 1)
                If @error Then MsgBox(4096, 'Lỗi', 'Không lấy được địa chỉ tải')
                ConsoleWrite(@CRLF & $LinkDownload[0] & @CRLF)
                ShellExecute($LinkDownload[0])
                ExitLoop GUIDelete($Form_Phu)
        EndSwitch
    WEnd
EndFunc

Func _Login($Cookie = '')
    If $Cookie = '' Then $Cookie = _GetCookie(_HttpRequest(1, $iURL, '', '', '', 'DNT: 1'))
    _HttpRequest(1, $iURL, 'user_name=' & _URIEncode($iUser) & '&user_pwd=' & _URIEncode($iPass) & '&btnLogin=Login', $Cookie, $iURL, 'DNT: 1')
    $SourceAfterLogin = _HttpRequest(2, $iURL, '', $Cookie, $iURL, 'DNT: 1')
    $SourceAfterLogin = _Cut_String($SourceAfterLogin, 'DRIVER CARD MÀN HÌNH', 'Thông tin Saleman - Kỹ Thuật Viên') ;loại bỏ các đoạn thừa
    $SourceAfterLogin = StringReplace($SourceAfterLogin, @CRLF, '')
    $SourceAfterLogin = StringReplace($SourceAfterLogin, '</a>', @CRLF) ;chuyển </a> thành ký tự xuống hàng để dễ dùng Regexp hơn
    Local $Result[2] = [$Cookie, $SourceAfterLogin]
    Return $Result ; array[0] = Cookie, array[1] = source của trang sau khi login
EndFunc

Func _ControlGetPos($idCtrl)
    Return WinGetPos(GUICtrlGetHandle($idCtrl))
EndFunc

Func _Cut_String($sString, $sBegin, $sEnd, $iByPassToEnd = 0)
    $Result = StringRegExp($sString, '(?is)\Q' & $sBegin & '\E(.*' & ($iByPassToEnd = 0 ? '?' : '') & ')\Q' & $sEnd & '\E', 1)
    Return @error ? $sString : $Result[0]
EndFunc

 ;---------------Scanner IP---------------
Case $scanip
TCPStartup()


$TimeoutDefault = 500 ; timeout in miliseconds
Global $HostName, $WhichList, $List, $Used, $StartTime, $Finished, $CurrentIP, $CurrentIndex, $FreeCount, $Progress, $CurrentlyScanning, $FinishMessage, $fDblClkMessage
Global Const $MAX_PROCESS = 30 ; maximum processes at once
Global $fDblClk = False, $aLV_Click_Info

$Found = 0 ;how many active connections you have
$LocalIP1 = @IPAddress1
$LocalIP2 = @IPAddress2
$LocalIP3 = @IPAddress3
$LocalIP4 = @IPAddress4
If $LocalIP1 <> "0.0.0.0" Then $Found += 1
If $LocalIP2 <> "0.0.0.0" Then $Found += 1
If $LocalIP3 <> "0.0.0.0" Then $Found += 1
If $LocalIP4 <> "0.0.0.0" Then $Found += 1

If $Found == 0 Then
    MsgBox(16, "OOPS", "There are no adapters with an IP address present.  Please check your adapters and cables.")
    Exit
EndIf
If $Found > 1 Then ; if there is more than one network available you will be prompted to choose which to scan
    $Choose = GUICreate("Choose an IP range", 240, 115, (@DesktopWidth / 2) - 120, @DesktopHeight / 4)
    GUISetBkColor(0xb2ccff, $Choose)
    GUISetFont(8.5)
    $IPShow = StringSplit($LocalIP1, ".")
    $Button1 = GUICtrlCreateButton($IPShow[1] & "." & $IPShow[2] & "." & $IPShow[3] & ".xxx", 5, 5, 110, 40)
    $IPShow = StringSplit($LocalIP2, ".")
    $Button2 = GUICtrlCreateButton($IPShow[1] & "." & $IPShow[2] & "." & $IPShow[3] & ".xxx", 125, 5, 110, 40)
    $IPShow = StringSplit($LocalIP3, ".")
    $Button3 = GUICtrlCreateButton($IPShow[1] & "." & $IPShow[2] & "." & $IPShow[3] & ".xxx", 5, 50, 110, 40)
    $IPShow = StringSplit($LocalIP4, ".")
    $Button4 = GUICtrlCreateButton($IPShow[1] & "." & $IPShow[2] & "." & $IPShow[3] & ".xxx", 125, 50, 110, 40)

    If @IPAddress1 == "0.0.0.0" Then GUICtrlDelete($Button1)
    If @IPAddress2 == "0.0.0.0" Then GUICtrlDelete($Button2)
    If @IPAddress3 == "0.0.0.0" Then GUICtrlDelete($Button3)
    If @IPAddress4 == "0.0.0.0" Then GUICtrlDelete($Button4)
    GUISetState(@SW_SHOW, "Choose an IP range")
    Do
        $MSG = GUIGetMsg()
        If $MSG == $GUI_EVENT_CLOSE Then Exit
        If $MSG == $Button1 Then
            $ChosenIP = @IPAddress1
            ExitLoop
        EndIf
        If $MSG == $Button2 Then
            $ChosenIP = @IPAddress2
            ExitLoop
        EndIf
        If $MSG == $Button3 Then
            $ChosenIP = @IPAddress3
            ExitLoop
        EndIf
        If $MSG == $Button4 Then
            $ChosenIP = @IPAddress4
            ExitLoop
        EndIf
    Until 1 == 2
    GUIDelete("Choose an IP range")
Else ; if only one network is available, skip the selection GUI and go
    If $LocalIP1 <> "0.0.0.0" Then $ChosenIP = $LocalIP1
    If $LocalIP2 <> "0.0.0.0" Then $ChosenIP = $LocalIP2
    If $LocalIP3 <> "0.0.0.0" Then $ChosenIP = $LocalIP3
    If $LocalIP4 <> "0.0.0.0" Then $ChosenIP = $LocalIP4
EndIf

$GUI = GUICreate("IP Scanner", 510, 400)
GUISetBkColor(0xb2ccff, $GUI)
GUISetFont(8.5)
$PingSpecific = GUICtrlCreateButton("&Ping IP cụ thể ", 105, 5, 90, 45)
GUICtrlSetTip(-1, "Scan một IP cụ thể")
$Rescan = GUICtrlCreateButton("Resca&n", 10, 5, 90, 45)
$Unused = _GUICtrlListView_Create($GUI, "IP không sử dụng", 10, 55, 140, 260)
_GUICtrlListView_SetColumnWidth($Unused, 0, 120)
$Used = _GUICtrlListView_Create($GUI, "IP Address|Host Name|Time", 160, 55, 340, 260)
_GUICtrlListView_SetColumnWidth($Used, 0, 95)
_GUICtrlListView_SetColumnWidth($Used, 1, 169)
_GUICtrlListView_SetColumnWidth($Used, 2, 50)
$ExternalIP=GUICtrlCreateLabel("", 10, 355, 260, 15)
Local $StatusParts[4] = [250, 510, -1]
$StatusBar = _GUICtrlStatusBar_Create($GUI)
_GUICtrlStatusBar_SetParts($StatusBar, $StatusParts)
GUISetState(@SW_SHOW, $GUI)

GUIRegisterMsg($WM_NOTIFY, "_DoubleClick")

$Gateway=_GetGateway()
_Scan()

Do
    $MSG = GUIGetMsg()
    If $MSG == $GUI_EVENT_CLOSE Then Exit
    If $MSG == $PingSpecific Then
        $GetSpecific=InputBox("Địa chỉ IP","Nhập địa chỉ IP")
        _PingSpecific($GetSpecific)
    EndIf
    If $MSG == $Rescan Then
        _GUICtrlListView_DeleteAllItems($Used)
        _GUICtrlListView_DeleteAllItems($Unused)
        _Scan()
    EndIf
    If $fDblClk Then
        $fDblClk = False
        Switch $aLV_Click_Info[1]
            Case 0 ; On Item
                $sText = _GUICtrlListView_GetItemText($Used, $aLV_Click_Info[0])
                _PingSpecific($sText)
        EndSwitch
    EndIf
Until 1 == 2
Exit


func _GetGateway()
    $zPID = Run(@ComSpec & " /c" & "ipconfig","", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    Local $zOutput = ""
    While 2
        $zOutput &= StdoutRead($zPID)
        If @error Then ExitLoop
    Wend
    $zBreak=StringSplit($zOutput,@CR)
    for $a=1 to $zBreak[0]
        if StringInStr($zBreak[$a],$ChosenIP) Then
            $zGetGatewayLine=$zBreak[$a+2]
            $zGetGateway=StringMid($zGetGatewayLine,41,StringLen($zGetGatewayLine)-40)
            ExitLoop
        EndIf
    next
    return $zGetGateway
EndFunc

Func _Scan()
    GUICtrlDelete($FinishMessage)
    GUICtrlDelete($fDblClkMessage)
    GUICtrlSetState($PingSpecific, $GUI_DISABLE)
    GUICtrlSetState($Rescan, $GUI_DISABLE)
    $Progress = GUICtrlCreateProgress(10, 310, 490, 20)
    $ScanningMessage = GUICtrlCreateLabel("Đang scan IP:", 10, 340, 95, 15)
    $CurrentlyScanning = GUICtrlCreateLabel("", 105, 340, 80, 15)

    Local $a_process[$MAX_PROCESS] ; an array to keep a reference to spawned processes, in the next loop we fill it with value 0
    For $n = 0 To UBound($a_process) - 1
        $a_process[$n] = 0
    Next

    $Oct = StringSplit($ChosenIP, ".")
    $Range = $Oct[1] & "." & $Oct[2] & "." & $Oct[3] & "." ; now we just add an incrementing number and ping away
    Local $Address[255]
    For $i = 0 To 254
        $Address[$i] = $Range & $i ; we generate some IPs
    Next

    Local $i = 0 ; a pointer to run through the $Address array
    $Finished = 0 ; <==== new line
    $CurrentIndex = 0; needed to keep the _GUICtrlListView_AddSubItem working right...
    $FreeCount = 0
    AdlibRegister("_Display", 100)
    $StartTime = TimerInit()

    Do
        ; check on the current processes, and look if there is one finished for use with our next host in line (from $Address)
        For $n = 0 To UBound($a_process) - 1
            $MSG = GUIGetMsg()
            If $MSG == $GUI_EVENT_CLOSE Then Exit
            If($i <> UBound($Address) And $a_process[$n] == 0) Then ; check if we need a spot, and there is an existing spot
                ; there is an empty spot
                $a_process[$n] = _MSPing($Address[$i])
                $i += 1
            Else
                ; something is running here, let's check on the output
                If($a_process[$n] <> 0 And _MSPingIsReady($a_process[$n])) Then
                    $CurrentIP = _MSPingGetHostname($a_process[$n])
                    $PingTime = _MSPingGetResult($a_process[$n])
                    $ShowHost = StringSplit($CurrentIP, ".")
                    $LastOct = StringFormat("%.3i", $ShowHost[4])
                    If($PingTime <> -1) Then
                        _GUICtrlListView_AddItem($Used, $ShowHost[1] & "." & $ShowHost[2] & "." & $ShowHost[3] & "." & $LastOct, $CurrentIndex)
                        _GUICtrlListView_AddSubItem($Used, $CurrentIndex, $PingTime & "ms", 2)
                        _GUICtrlListView_AddSubItem($Used, $CurrentIndex, "looking up host name.....", 1)
                        $HostName = _HostName($CurrentIP)
                        _GUICtrlListView_AddSubItem($Used, $CurrentIndex, $HostName, 1)
                        $CurrentIndex += 1
                    Else
                        $FreeCount += 1
                        _GUICtrlListView_AddItem($Unused, $ShowHost[1] & "." & $ShowHost[2] & "." & $ShowHost[3] & "." & $LastOct, $CurrentIndex)
                    EndIf
                    ; free up an empty space for the next address to Ping
                    $a_process[$n] = 0
                    $Finished += 1 ; <=== new line
                    If($Finished == UBound($Address)) Then
                        ExitLoop 2 ; return
                    EndIf
                EndIf
            EndIf
        Next
    Until 1 == 2
    AdlibUnRegister()
    _Display()
    GUICtrlDelete($Progress)
    GUICtrlDelete($ScanningMessage)
    GUICtrlDelete($CurrentlyScanning)
    GUICtrlSetState($PingSpecific, $GUI_ENABLE)
    GUICtrlSetState($Rescan, $GUI_ENABLE)
    $FinishMessage = GUICtrlCreateLabel("Hoàn thành scanning IP trong " & Round((TimerDiff($StartTime) / 1000), 2) & " giây", 105, 315, 300, 20, $SS_CENTER)
    $fDblClkMessage = GUICtrlCreateLabel("Double click vào IP để ping", 10, 335, 180, 20)
EndFunc   ;==>_Scan

Func _PingSpecific($PingIP)
    SplashTextOn("", "Vui lòng đợi, đang Ping IP :" & $PingIP, 200, 80, (@DesktopWidth / 2) - 100, (@DesktopHeight / 2) - 40)
    $CMD = "ping " & $PingIP & " -n 4"
    $PID = Run($CMD, @ScriptDir, @SW_HIDE, "0x2")
    $Text = ""
    While ProcessExists($PID)
        $Line = StdoutRead($PID, 0)
        If @error Then ExitLoop
        $Text &= $Line
    WEnd
    SplashOff()
    MsgBox(64, "Kết quả", $Text)
EndFunc   ;==>_PingSpecific

Func _MSPing($CurrentIP, $Timeout = $TimeoutDefault)
    Local $Return_Struc[4]
    ; [0] = Result (in ms)
    ; [1] = The hostname originally used
    ; [2] = Process handle (for internal use only)
    ; [3] = Buffer (for internal use only)
    $Return_Struc[1] = $CurrentIP
    $Return_Struc[2] = Run("ping " & $CurrentIP & " -n 1 -w " & $Timeout, "", @SW_HIDE, $STDOUT_CHILD)
    Return $Return_Struc
EndFunc   ;==>_MSPing
Func _MSPingIsReady(ByRef $Return_Struc)
    Return ___MSPingReadOutput($Return_Struc)
EndFunc   ;==>_MSPingIsReady
Func _MSPingGetResult($Return_Struc)
    Return $Return_Struc[0]
EndFunc   ;==>_MSPingGetResult
Func _MSPingGetHostname($Return_Struc)
    Return $Return_Struc[1]
EndFunc   ;==>_MSPingGetHostname
; Internal use only
Func ___MSPingReadOutput(ByRef $Return_Struc)
    $data = StdoutRead($Return_Struc[2])
    If(@error) Then
        ___MSPingParseResult($Return_Struc)
        Return 1
    Else
        $Return_Struc[3] &= $data
        Return 0
    EndIf
EndFunc   ;==>___MSPingReadOutput
; Internal use only
Func ___MSPingParseResult(ByRef $Return_Struc)
    $Result = StringRegExp($Return_Struc[3], "([0-9]*)ms", 3)
    If @error Then
        $Return_Struc[0] = -1
    Else
        $Return_Struc[0] = $Result[0]
    EndIf
EndFunc   ;==>___MSPingParseResult

Func _HostName($CurIP)
    GUICtrlSetData($CurrentlyScanning, $CurrentIP)
    $DevName = _TCPIpToName($CurIP)
    If @error Then $DevName = "Unknown"
    if $CurIP==$ChosenIP Then
        $DevName&=" (** this PC)"
    endif
    if $CurIP==$Gateway Then
        $DevName&=" (** MODEM)"
    endif
    Return $DevName
EndFunc   ;==>_HostName


Func _Display()
    GUICtrlSetData($Progress, ($Finished / 255) * 100)
    GUICtrlSetData($CurrentlyScanning, $CurrentIP)
    _GUICtrlStatusBar_SetText($StatusBar, "Địa chỉ IP được sử dụng: " & $CurrentIndex, 0)
    _GUICtrlStatusBar_SetText($StatusBar, "Địa chỉ IP không sử dụng: " & $FreeCount, 1)
EndFunc   ;==>_Display

; WM_NOTIFY event handler
Func _DoubleClick($hWnd, $iMsg, $iwParam, $ilParam)
    Local $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    If HWnd(DllStructGetData($tNMHDR, "hWndFrom")) == $Used And DllStructGetData($tNMHDR, "Code") == $NM_DBLCLK Then
        $aLV_Click_Info = _GUICtrlListView_SubItemHitTest($Used)
        ; as long as the click was on an item or subitem
        If $aLV_Click_Info[0] <> -1 Then $fDblClk = True
    EndIf
    Return $GUI_RUNDEFMSG
 EndFunc   ;==>_DoubleClick

;-----------------------
Case $GUI_EVENT_CLOSE
SplashTextOn("Thông báo", "Đang xóa rác....", 400, 55, -1, -1, 1, "Times New Roman", 24)
If @OSVersion = "WIN_XP" Then
   RunWait('"'&@ComSpec&'" /c del /f /s /q /a "%userprofile%\Local Settings\Temp\*.*"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c rd /s /q "%userprofile%\Local Settings\Temp"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c md "%userprofile%\Local Settings\Temp"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c del /f /s /q /a "%userprofile%\Recent\*.*"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c rd /s /q "%userprofile%\Recent"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c md "%userprofile%\Recent"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c del /f /s /q /a "%userprofile%\Cookies\*.*"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c rd /s /q "%userprofile%\Cookies"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c md "%userprofile%\Cookies"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c del /f /s /q /a "%windir%\temp\*.*"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c rd /s /q "%windir%\temp"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c md "%windir%\temp"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c del /f /s /q /a "%userprofile%\Local Settings\History\*.*"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c rd /s /q "%userprofile%\Local Settings\History"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c md "%userprofile%\Local Settings\History"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c del /f /s /q /a "%userprofile%\NetHood\*.*"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c rd /s /q "%userprofile%\NetHood"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c md "%userprofile%\NetHood"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c del /f /s /q /a "%userprofile%\Local Settings\Temporary Internet Files\*.*"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c rd /s /q "%userprofile%\Local Settings\Temporary Internet Files"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c md "%userprofile%\Local Settings\Temporary Internet Files"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c del /f /s /q /a "%userprofile%\AppData\Local\Temporary Internet Files\*"',@SystemDir,@SW_HIDE)
EndIf
If @OSVersion = "WIN_7" Then
   RunWait('"'&@ComSpec&'" /c del /f /s /q /a "%userprofile%\AppData\Local\Temp\*.*"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c rd /s /q "%userprofile%\AppData\Local\Temp"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c del /f /s /q /a "%userprofile%\Recent\*.*"',@SystemDir,@SW_HIDE)
   RunWait('"'&@ComSpec&'" /c rd /s /q "%userprofile%\Recent"',@SystemDir,@SW_HIDE)
EndIf
     SplashOff()
 MsgBox(0, "Thông báo", "Hoàn thành dọn dẹp rác  !")
$question = MsgBox(4, "Thông báo", "Bạn cần khởi động lại máy tính")
If $question == 6 Then
  Shutdown(2)
EndIf
    If FileExists(@MyDocumentsDir & "\3DPChip.exe") Then
          FileDelete(@MyDocumentsDir & "\3DPChip.exe")
    EndIf
    If FileExists(@MyDocumentsDir & "\Speccy.exe") Then
          FileDelete(@MyDocumentsDir & "\Speccy.exe")
       EndIf
    RunWait('"'&@ComSpec&'" /c sc config "wuauserv" start=  Disabled',@SystemDir,@SW_HIDE)
    RunWait('"'&@ComSpec&'" /c sc stop "wuauserv"',@SystemDir,@SW_HIDE)
        If FileExists($sFilePath) Then
          FileDelete($sFilePath)
       EndIf

       Exit
  EndSwitch
WEnd


Func
^
"C:\Users\iCafe8\Desktop\12.au3"(622,12) : REF: missing EndSwitch.
Switch $MSG
~~~~~~~~~~~^
"C:\Users\iCafe8\Desktop\12.au3"(1557,1) : error: missing Wend.
Func
^
"C:\Users\iCafe8\Desktop\12.au3"(620,1) : REF: missing Wend.
While
^
"C:\Users\iCafe8\Desktop\12.au3"(1661,1) : error: syntax error
Case
^
"C:\Users\iCafe8\Desktop\12.au3"(1661,1) : error: Statement cannot be just an expression.
Case
^
"C:\Users\iCafe8\Desktop\12.au3"(1661,13) : error: Statement cannot be just an expression.
Case $scanip
~~~~~~~~~~~~^
"C:\Users\iCafe8\Desktop\12.au3"(1958,1) : error: syntax error
Case
^
"C:\Users\iCafe8\Desktop\12.au3"(1958,1) : error: Statement cannot be just an expression.
Case
^
"C:\Users\iCafe8\Desktop\12.au3"(1958,22) : error: Statement cannot be just an expression.
Case $GUI_EVENT_CLOSE
~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\iCafe8\Desktop\12.au3"(2009,3) : error: syntax error
  EndSwitch
~~^
"C:\Users\iCafe8\Desktop\12.au3"(2009,3) : error: Statement cannot be just an expression.
  EndSwitch
~~^
"C:\Users\iCafe8\Desktop\12.au3"(2010,1) : error: Statement cannot be just an expression.
WEnd
^
C:\Users\iCafe8\Desktop\12.au3 - 11 error(s), 0 warning(s)
>Exit code: 2    Time: 0.5937
 

Share this post


Link to post
Share on other sites
jchd

Tidy your script.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
water

Looks like a problem with a missing quote.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
khidotdn

 

please help me , I did not sleep for 2 days

Share this post


Link to post
Share on other sites
jchd

So tidy your script!

The endswitch and wend in line 1391+ of the piece of code you posted should probably go to line 929.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.