During 1799 and 1800 Betancourt is completely involved in the project of the telegraphic line from Madrid to Cádiz, for which several amounts of money are forwarded in the first months of 1799. His brother Marcos goes to collaborate with him in Madrid. It was calculated that they would have to install between 60 and 70 telegraphs and it would take twenty months to do the job. The return of Agustín to Madrid appears in a press note sent by the correspondent of the French gazette La Chronica Universal in January 1799, marking his international popularity in Europe [See press note: Letter 18].
During these years he attends regularly the sessions of the Academia de San Fernando again, participating actively on its boards and committees.
Between April and September 1799 Betancourt acquires the Real Fabrica de Algodón of Ávila for commercial exploitation, which will make him spend this and successive summers in this locality.
On June 12th 1799 the Inspección General de Caminos y Canales is established, as a technical organ for the management of public works, dependant of the Superintendencia General de Correos y Caminos held by the secretary of State. Betancourt rejects the post of director of the Inspección, too busy with the telegraph affair, and this job befalls on José Nadín y Guzman, count of Guzman; only taking charge towards the end of 1801.
In October 1800, through decision of the Treasury Secretary Cayetano Soler, the works on the telegraph are paralyzed due to economic problems. They were only able to build four telegraphic towers between Madrid and Aranjuez that had come into service some months before.
His daughter Matilde is born in 1801. He publishes his Medio para que de un aqüeducto no salga más agua que la necesaria para mantener lleno un pilón in the Semanario de Agricultura, system that shall be used to supply the foundry of Buen Retiro.
In September 1801 Betancourt makes a reconnaissance of the Canal de Castilla with views to its reactivation and writes out a report with Peñalver.
On December 27th he is named Inspector General de Caminos y Canales.
It is at this time is when he invents the plunger piston lock: a reduced model of it is incorporated to the Gabinete de Máquinas and a replica is sent to the Museum of the École des Ponts et Chaussées.
Among the public works that are supervised by Betancourt as inspector, we can underline the breakage of the second reservoir at Puentes in Lorca (Murcia) in April 1802, which caused 608 victims. The Informe dado por D. Agustín de Betancourt sobre los Pantanos y Reparos que deben hacerse en Lorca is considered the beginning of the creation of the Escuela de Caminos y Canales, because it defends the need to form technicians for the building of public works of the State, and it seems to have an effect in the official spheres. His disciple Rafael Bauzá will end up looking after the reservoir of Lorca.
During this year Betancourt examines several bridges in Valencia and other places, repairs or builds 140 bridges on the road from Madrid to Barcelona, and in the area of Zaragoza and Valencia, due to the royal routes of the Prince of Asturias and his sister, who both celebrate their marriages on the same date: the 4th of October.
Between 1802 and 1805, his contact with Lanz at the School leads to a joint collaboration in the redaction of their first draft of their Essai sur la composition des machines, that will be published in 1808 in Paris.
In 1803 he presents to the minister Cevallos his memoir Noticia del estado actual de los caminos y canales de España, causa de sus atrasos y defectos, y medios para remediarlos en adelante.This memoir recounts his inspection works of these years as well as many inspection trips projected for the years to come, he also designs the reorganization of the organism in charge of canals and bridges and of the functions of the new engineers.
Between June 1803 and October 1805 Betancourt is involved in a constant hassle with Godoy because of the works at a country estate that the latter had at Granada called “Soto de Roma”. After many works, natural disasters and other mishaps, Godoy removes Betancourt –more likely Rafael Bauzá who was in charge of the works- from the matter, naming other engineers; this contributed to tense the relationship between Godoy and Betancourt even more.
Introduced in July through a Royal Decree, the official denomination of the Escuela de Caminos y Canales converts into Engineers of Roads and Canals the members of the correspondent General Inspection.

They translate the following books for the School: Géométrie Descriptive de Gaspard Monge and Mécanique Elémentaire of Francoeur.
Betancourt is named quartermaster general of the army in October 1803.
In December of this year the Imprenta Real prints the plate that reproduces the machine to cut grass in rivers and canals prized in London in 1795 and dedicated to Godoy.
In 1804 the first promotion of engineers of roads and canals finish their studies, among others, Rafael Bauzá. There will be three more promotions until 1807, and the promotion that began in 1806 was not able to complete their last course. It seems that Lanz had proposed modifications to the plan of studies or maybe a new plan, which has not been conserved.
At the beginning of 1805 Betancourt is going through a difficult economic situation mainly due to the factory at Ávila that is not going well, and he is trying to get rid of it. But the government will only accept to cancel the contract in July 1806 and then let Betancourt return it to the State. Bartolomé Sureda had been working there for nearly three years.
Meanwhile, on November 15th Alfonso, the only son of Betancourt was born. And in January 1806 his brother Marcos, lieutenant of the Royal Navy had died.
Since April 1806 Betancourt is thinking about leaving Spain, due to the political events and his disagreements with Godoy and, in fact, his wife had already been installed in Paris since July. Our engineer by then had given a power of attorney to José Sureda to administer his goods.
But Betancourt will still take some months to move to France. He has to tie up some of his affairs, among them the liquidation of the industry at Avila that, in the end, he could not return to the State and he had to sell to his friend Ingram Binns.
Between July and September 1806 they approve and begin the works at Lorca, following Betancourt’s report, Rafael Bauzá and an engineer from Murcia direct the works.
On March 2nd 1807 Betancourt and James Watt are named correspondents of the Académie des Sciences of Paris in the same session.
In mid May, at last, Betancourt obtains a temporary licence to move to Paris, licence that will become definitive, because he never returned to Spain.

