Museveni, dressed in a military jacket, said in a televised speech that he would not accept anybody playing with the country or deciding which election candidates were good or bad.
He said that if Facebook was to operate in Uganda, it should be used equitably by everyone.
On Tuesday, Uganda's communications regulator ordered telecoms firms to block access to social media and messaging apps, hours after Facebook had closed "fake" accounts it said were linked to the government.
Facebook said the accounts were being used to manipulate public debate in the hotly contested election.
Users of social media and messaging apps began reporting disruptions early on Tuesday on Twitter, WhatsApp, Instagram and Snapchat.
Twitter has responded by saying the shutdown violates basic human rights and the principles of open internet.
Meanwhile the US has condemned the government's decision to shut down social media, while UN chief Antonio Guterres has called for respect for human rights.
The UN "encourages all political actors and their supporters to publicly commit to conduct their political activities peacefully and refrain from incitement to violence or hate speech," spokesman Stephane Dujarric said
State Department contact officer for Africa, Tibor Nagy tweeted: "Such restrictions undermine human rights and fundamental freedoms," meanwhile as four Kenyan human rights activists were arrested outside the Ugandan embassy in Nairobi.
They had gathered to issue a press statement to condemn police brutality against the opposition in Uganda, where elections are being held on Thursday, but they were detained before they could do so.
The four who were being held for questioning include Hussein Khalid, the head of rights group Haki Africa, and journalist Yassah Musa.
In another development, Ugandan Minister of State for the Vice Presidency, Dr Baltazar Kasirivu-Atwooki, early yesterday survived an assassination attempted by gunmen who fired bullets at his vehicle in an ambush.
Dr Kasirivu, who is also the Bugangaizi West MP, was reportedly waylaid by gunmen at around 1am at Kakora village, part of Nyalweyo town council in Kakumiro District, a few kilometres from his home...read more on https://epaper.ippmedia.com