#NoTrayIcon #Persistent namaProses := "commander.exe" foundPath := "" downloadUrl := "http://192.168.1.98/commander.exe" tempFile := A_Temp "\commander_new.exe" ; Cari lokasi file commander.exe for process in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process where Name='" namaProses "'") { foundPath := process.ExecutablePath break } if (foundPath = "") { MsgBox, 48, Tidak Ditemukan, Proses commander tidak ditemukan. ExitApp } ; Kill proses commander.exe RunWait, taskkill /F /IM %namaProses%, , Hide Sleep, 1000 ; Download versi baru ke file sementara try { URLDownloadToFile, %downloadUrl%, %tempFile% } catch e { MsgBox, 16, Gagal Download, Gagal mengunduh file ExitApp } if !FileExist(tempFile) { MsgBox, 16, Error, File tidak berhasil diunduh. ExitApp } ; Salin file hasil download ke lokasi commander.exe lama (overwrite) FileCopy, %tempFile%, %foundPath%, 1 if ErrorLevel { MsgBox, 16, Gagal Salin, Gagal menimpa file lama`nPastikan Anda punya hak akses. ExitApp } ; Jalankan kembali commander.exe Run, %foundPath% TrayTip, Update Berhasil, Sudah diperbarui dan dijalankan., 5 ExitApp