When God speaks,that is the end of the matter. The Analekites played into the hands of God. In this verse , God instructed Moses to write a judgement against them. It took a few hundred years, but the Amalekites were finished. The fulfilment came in 1Chron.4:43, under the reign of Hezekiah and 1Sam.15:3, under the reign of Saul. They touched Gods firstborn, the people of Israel. God also used the occasion to subtlety introduce the next leader,Joshua. By mentioning him, God reminded Moses that his time would soon be up. The matter was written in a book which appears to have already been in existence. It was to be a reminder. God will still react like this if someone touches His anointed( Psa.105:15; 1Chron.16:22). In Acts 23:5,Paul apologised for speaking against the anointed of God. We will not raise the arguments of who the anointed is. That has been done down the history of the church. Today, whoever comes against you in God’s divine restoration, this judgement is written against them. Now the devil and his cohorts are in trouble.
And the Lord said unto Moses, Write this for a memorial in a book, and rehearse it in the ears of Joshua: for I will utterly put out the remembrance of Amalek from under heaven. Exodus 17:14 KJV