Friday, March 20, 2020

Run Batch Files (DOS Commands) From Visual Studio

Run Batch Files (DOS Commands) From Visual Studio Microsoft Visual Studio integrated development environment doesnt run DOS commands, but you can change that fact with a batch file. When IBM introduced PCs, batch files and the original BASIC  programming language were among the few ways to write programs. Users became experts at programming DOS commands. About Batch Files Batch files might be called scripts or macros in another context. Theyre just text files filled with DOS commands. For example: ECHO off ECHO Hello About Visual Basic! ECHO on The suppresses the display of the current statement to the console. So, the command ECHO off is not displayed.ECHO off and ECHO on toggles whether statements are displayed. So, after ECHO off, statements are not displayed.ECHO Hello About Visual Basic! displays the text Hello About Visual Basic!ECHO on switches the ECHO function back on so anything following is displayed. All of this was just to ensure that the only thing you actually see in the console window is the message. How to Execute a Batch File in Visual Studio The key to executing a batch file directly in Visual Studio is to Add one using the External Tools selection of the Tools menu. To do this, you: Create a simple batch program that executes other batch programs.Reference that program using the External Tools selection in Visual Studio. To be complete, add a reference to Notepad in the Tools menu. A Batch Program That Executes Other Batch Programs Heres the batch program that will execute other batch programs: cmd /c %1 pause The /c parameter carries out the command specified by string and then terminates. The %1 accepts a string that the cmd.exe program will try to execute. If the pause command wasnt there, the command prompt window would close before you could see the result. The pause command issues the string, press any key to continue. Tip: You can get a fast explanation of any console command- DOS- using this syntax in a command prompt window: /? Save this file using any name with the file type .bat.   You can save it in any location, but the Visual Studio directory in Documents is a good place.   Add an Item to External Tools The final step is to add an item to the External Tools in Visual Studio. Click Here to display the illustration If you simply click the Add button, then you get a complete dialog that allows you to specify every detail possible for an external tool in Visual Studio. Click Here to display the illustration In this case, enter the complete path, including the name you used when you saved your batch file earlier, in the Command textbox. For example: C:\Users\Milovan\Documents\Visual Studio 2010\RunBat.bat You can enter any name you like in the Title textbox. At this point, your new batch file executing command is ready. Just to be complete, you can also add the RunBat.bat file to the External Tools a different way as shown below: Click Here to display the illustration Rather than make this file the default editor in External Tools, which will cause Visual Studio to use RunBat.bat for files that are not batch files,  execute the batch file by selecting Open With... from a context menu. Click Here to display the illustration Because a batch file is just a text file that is qualified with the .bat type (.cmd works too), you might think that you can use the Text File template in Visual Studio to add one to your project. You cant. As it turns out, a Visual Studio Text File is not a text file. To demonstrate this, right-click the project and use Add New Item ...  to add a text file to your project. You have to change the extension so it ends in .bat. Enter the simple DOS command, Dir (display a directory contents) and click OK to add it to your project. If you then try to execute this batch command, you get this error: nDir is not recognized as an internal or external command, operable program or batch file. That happens because the default source code editor in Visual Studio adds header information to the front of every file. You need an editor, like Notepad, that doesnt. The solution here is to add Notepad to External Tools. Use Notepad to create a batch file. After you save the batch file, you still have to add it to your project as an existing item.

Wednesday, March 4, 2020

1600s 1700s Military History Timeline

1600s 1700s Military History Timeline Timeline Home | to 1000 | 1001-1200 | 1201-1400 | 1401-1600 | 1801-1900 | 1901-present 1600s 1602 - Eighty Years War: Maurice of Orange captures Grave 1609 - Eighty Years War: The Twelve Years Truce ends fighting between the United Provinces and Spain May 23, 1618 - Thirty Years War: The Second Defenestration of Prague leads to the outbreak of the conflict November 8, 1620 - Thirty Years War: Ferdinand II defeats Ferdinand V at the Battle of White Mountain April 25, 1626 - Thirty Years War: Albrecht von Wallenstein leads Catholic forces to victory at the Battle of Dessau Bridge September 17, 1631 - Thirty Years War: Swedish forces led by King Gustavus Adolphus win the Battle of Breitenfeld November 16, 1632 - Thirty Years War: Swedish troops win the Battle of Là ¼tzen, but Gustavus Adolphus is killed in the fighting 1634-1638 - American Colonies: English settles and their Native American allies win the Pequot War December 17, to April 15, 1638 - Shimabara Rebellion: A peasant rebellion takes place on Japans Shimabara Peninsula September 23, 1642 - English Civil War: Royalist and Parliamentarian forces clash at the Battle of Powick Bridge October 23, 1642 - English Civil War: The first pitched battle of the conflict is fought at Edgehill May 19, 1643 - Thirty Years War: French troops win the Battle of Roncroi July 13, 1643 - English Civil War: The Royalists win the Battle of Roundway Down September 20, 1643 - English Civil War: Royalist and Parliamentary forces meet at the First Battle of Newbury December 13, 1643 - English Civil War: Parliamentary troops win the Battle of Alton July 2, 1644 - English Civil War: Parliamentary forces win the Battle of Marston Moor June 14, 1645 - English Civil War: Parliamentarian troops crush Royalist forces at the Battle of Naseby July 10, 1645 - English Civil War: Sir Thomas Fairfax wins the Battle of Langport September 24, 1645 - English Civil War: Parliamentarian forces win the Battle of Rowton Heath May 15 October 24, 1648 - Thirty Years War: The Peace of Westphalia ends both the Thirty and Eighty Years War August 17-19, 1648 - English Civil War: Oliver Cromwell wins the Battle of Preston September 3, 1651 - English Civil War: Parliamentarian forces win the Battle of Worcester July 10, 1652 - First Anglo-Dutch War: The English Parliament declares war on the Dutch Republic May 8, 1654 - First Anglo-Dutch War: The Treaty of Westminster ends the conflict 1654 - Anglo-Spanish War: Driven by commercial rivalry, England declares war on Spain September 1660 - Anglo-Spanish War: After the restoration of Charles II, the war comes to an end March 4, 1665 - Second Anglo-Dutch War: The conflict begins after the Dutch permit their ships to fire when threatened May 24, 1667 - War of Devolution: France invades the Spanish Netherlands starting the war June 9-14, 1667 - Second Anglo-Dutch War: Admiral Michiel de Ruyter leads a successful raid on the Medway July 31, 1667 - Second Anglo-Dutch War: The Treaty of Breda ends the conflict May 2, 1668 - War of Devolution: Louis XIV agrees to the Triple Alliances demands bringing the war to a close April 6, 1672 - Third Anglo-Dutch War: England joins France and declares war on the Dutch Republic February 19, 1674 - Third Anglo-Dutch War: The Second Peace of Westminster ends the war June 20, 1675 - King Philips War: A band of Pokanoket warriors attacks the Plymouth colony opening the war August 12, 1676 - King Philips War: King Philip is killed by colonists effectively ending the war 1681 - War of 27 Years: Fighting begins between the Marathas and Mughals in India 1683 - War of the Holy League: Pope Innocent XI forms the Holy League to block Ottoman expansion in Europe September 24, 1688 - War of the Grand Alliance: Fighting begins as the Grand Alliance forms to contain French expansion July 27, 1689 - Jacobite Risings: Jacobite forces under Viscount Dundee win the Battle of Killiecrankie July 12, 1690 - War of the Grand Alliance: William III defeats James II at the Battle of the Boyne February 13, 1692 - Glorious Revolution: Members of Clan MacDonald are attacked during the Glencoe Massacre September 20, 1697 - War of the Grand Alliance: The Treaty of Ryswick ends the War of the Grand Alliance January 26, 1699 - War of the Holy League: The Ottomans sign the Treaty of Karlowitz ending the war February 1700 - Great Northern War: Fighting begins between Sweden, Russia, Demark, and Saxony 1701 - War of the Spanish Succession: Fighting begins as an alliance of Britain, the Holy Roman Empire, Dutch Republic, Prussia, Portugal, and Denmark declare war to prevent a French succession to the Spanish throne February 29, 1704 - Queen Annes War: French and Native American forces conduct the Raid on Deerfield August 13, 1704 - War of the Spanish Succession: The Duke of Marlborough wins the Battle of Blenheim May 23, 1706 - War of the Spanish Succession: Grand Alliance forces under Marlborough win the Battle of Ramillies 1707 - War of 27 Years: The Mughals are defeated ending the war July 8, 1709 - Great Northern War: Swedish forces are crushed at the Battle of Poltava March/April 1713 - War of the Spanish Succession: The Treaty of Utrecht ends the war December 17, 1718 - War of the Quadruple Alliance: The French, British, and Austrians declare war on Spain after Spanish troops land on Sardinia and Sicily June 10, 1719 - Jacobite Risings: Jacobite forces are beaten at the Battle of Glen Shiel February 17, 1720 - War of the Quadruple Alliance: The Treaty of The Hague ends the fighting August 20, 1721 - Great Northern War: The Treaty of Nystad ends the Great Northern War July 1722 - Russo-Persian War: Russian troops embark for an invasion of Iran September 12, 1723 - Russo-Persian War: The Russians compel Tahmasp II to sign a peace treaty Timeline Home | to 1000 | 1001-1200 | 1201-1400 | 1401-1600 | 1801-1900 | 1901-present 1730s February 1, 1733 - War of the Polish Succession: Augustus II dies creating the succession crisis that leads to war November 18, 1738 - War of the Polish Succession: The Treaty of Vienna settles the succession crisis December 16, 1740 - War of the Austrian Succession: Frederick the Great of Prussia invades Silesia opening the conflict April 10, 1741 - War of the Austrian Succession: Prussian forces win the Battle of Mollwitz June 27, 1743 - War of the Austrian Succession: The Pragmatic Army under King George II wins the Battle of Dettingen May 11, 1745 - War of the Austrian Succession: French troops win the Battle of Fontenoy June 28, 1754 - War of the Austrian Succession: Colonial forces complete the Siege of Louisbourg September 21, 1745 - Jacobite Uprising: Prince Charles forces win the Battle of Prestonpans April 16, 1746 - Jacobite Uprising: Jacobite forces are defeated by the Duke of Cumberland at the Battle of Culloden October 18, 1748 - War of the Austrian Succession: The Treaty of Aix-la-Chapelle ends the conflict July 4, 1754 - French Indian War: Lt. Colonel George Washington surrenders Fort Necessity to the French July 9, 1755 - French Indian War: Major General Edward Braddock is routed at the Battle of the Monongahela September 8, 1755 - French Indian War: British and colonial forces defeat the French at the Battle of Lake George June 23, 1757 - Seven Years War: Colonel Robert Clive wins the Battle of Plassey in India November 5, 1757 - Seven Years War: Frederick the Great wins the Battle of Rossbach December 5, 1757 - Seven Years War: Frederick the Great triumphs at the Battle of Leuthen June 8-July 26, 1758 - French Indian War: British forces conduct the successful Siege of Louisbourg June 20, 1758 - Seven Years War: Austria troops defeat the Prussians at the Battle of Domstadtl July 8, 1758 - French Indian War: British forces are beaten at the Battle of Carillon August 1, 1759 - Seven Years War: Allied forces defeat the French at the Battle of Minden September 13, 1759 - French Indian War: Major General James Wolfe wins the Battle of Quebec but is killed in the fighting November 20, 1759 - Seven Years War: Admiral Sir Edward Hawke wins the Battle of Quiberon Bay February 10, 1763 - Seven Years War: The Treaty of Paris ends the war in a victory for Britain and its allies August 5-6, 1763 - Pontiacs Rebellion: The British win the Battle of Bushy Run September 25, 1768 - Russo-Turkish War: The Ottoman Empire declares war on Russia following a border incident at Balta March 5, 1770 - Prelude to the American Revolution: British troops fire into a crowd at the Boston Massacre July 21, 1774 - Russo-Turkish War: The Treaty of Kuà §uk Kainarji ends the war in a Russian victory April 19, 1775 - American Revolution: The war begins with the Battles of Lexington Concord April 19, 1775-March 17, 1776 - American Revolutin: American troops conduct the Siege of Boston May 10, 1775 - American Revolution: American forces capture Fort Ticonderoga June 11-12, 1775 - American Revolution: American naval forces win the Battle of Machias June 17, 1775 - American Revolution: The British win a bloody victory at the Battle of Bunker Hill September 17-November 3, 1775 - American Revolution: American forces win the Siege of Fort St. Jean December 9, 1775 - American Revolution: Patriot forces win the Battle of Great Bridge December 31, 1775 - American Revolution: American forces are turned back at the Battle of Quebec February 27, 1776 - American Revolution: Patriot forces win the Battle of Moores Creek Bridge in North Carolian March 3-4, 1776 - American Revolution: American forces win the Battle of Nassau in the Bahama June 28, 1776 - American Revolution: The British at defeated near Charleston, SC at the Battle of Sullivans Island August 27, 1776 - American Revolution: Gen. George Washington is defeated at the Battle of Long Island September 16, 1776 - American Revolution: American troops win the Battle of Harlem Heights October 11, 1776 - American Revolution: Naval forces on Lake Champlain fight the Battle of Valcour Island October 28, 1776 - American Revolution: The British force the Americans to retreat at the Battle of White Plains November 16, 1776 - American Revolution: British troops win the Battle of Fort Washington December 26, 1776 - American Revolution: American troops win a daring victory at the Battle of Trenton January 2, 1777 - American Revolution: American troops hold at the Battle of the Assunpink Creek near Trenton, NJ January 3, 1777 - American Revolution: American forces win the Battle of Princeton April 27, 1777 - American Revolution: British forces win the Battle of Ridgefield July 2-6, 1777 - American Revolution: British forces win the Siege of Fort Tinconderoga July 7, 1777 - American Revolution: Colonel Seth Warner fights a determined rearguard action at the Battle of Hubbardton August 6, 1777 - American Revolution: American forces are beaten at the Battle of Oriskany September 3, 1777 - American Revolution: American and British troops clash at the Battle of Coochs Bridge September 11, 1777 - American Revolution - The Continental Army is defeated at the Battle of Brandywine September 26-November 16, 1777 - American Revolution: American forces fight the Siege of Fort Mifflin October 4, 1777 - American Revolution: British forces win the Battle of Germantown September 19 October 7, 1777 - American Revolution: Continental forces win the Battle of Saratoga Decebmer 19, 1777-June 19, 1778 - American Revolution: The Continental Army winters at Valley Forge June 28, 1778 - American Revolution: American troops engage the British at the Battle of Monmouth July 3, 1778 - American Revolution: Colonial forces are beaten at the Battle of Wyoming August 29, 1778 - American Revolution: The Battle of Rhode Island is fought north of Newport February 14, 1779 - American Revolution: American forces win the Battle of Kettle Creek July 16, 1779 - American Revolution: Brigadier General Anthony Wayne wins the Battle of Stony Point July 24-August 12, 1779 - American Revolution: The American Penobscot Expedition is defeated August 19, 1779 - American Revolution: Battle of Paulus Hook is fought September 16-October 18, 1779 - American Revolution: French American troops conduct the failed Siege of Savannah September 23, 1779 - American Revolution: John Paul Jones captures HMS Serapis March 29-May 12 - American Revolution: British forces win the Siege of Charleston May 29, 1780 - American Revolution: American forces are defeated at the Battle of Waxhaws October 7, 1780 - American Revolution: American militia wins the Battle of Kings Mountain in South Carolina January 17, 1781 - American Revolution: Brig. Gen. Daniel Morgan wins the Battle of Cowpens March 15, 1781 - American Revolution: American troops bleed the British at the Battle of Guilford Court House April 25, 1781 - American Revolution: British troops win the Battle of Hobkirks Hill in South Carolina September 5, 1781 - American Revolution: French naval forces win the Battle of the Chesapeake September 8, 1781 - American Revolution: British and American forces clash at the Battle of Eutaw Springs October 19, 1781 - American Revolution: General Lord Charles Cornwallis surrenders to Gen. George Washington ending the Siege of Yorktown April 9-12, 1782 - The British win the Battle of the Saintes September 3, 1783 - American Revolution: American independence is granted and the war concluded by the Treaty of Paris April 28, 1789 - Royal Navy: Acting Lieutenant Fletcher Christian deposes Lieutenant William Bligh during the Mutiny on the Bounty July 9-10, 1790 - Russo-Swedish War: Swedish naval forces triumph in the Battle of Svensksund April 20, 1792 - Wars of the French Revolution: The French Assembly votes to declare war on Austria beginning a series of conflicts in Europe September 20, 1792 - Wars of the French Revolution: French forces win a victory over Prussia at the Battle of Valmy June 1, 1794 - Wars of the French Revolution: Admiral Lord Howe defeats the French fleet at the Glorious First of June August 20, 1794 - Northwest Indian War: General Anthony Wayne defeats the Western Confederacy at the Battle of Fallen Timbers July 7, 1798 - Quasi-War: The US Congress rescinds all treaties with France beginning an undeclared naval war August 1/2, 1798 - Wars of the French Revolution: Rear Admiral Lord Horatio Nelson destroys a French fleet at the Battle of the Nile