How To Run A Command Prompt with Visual Studio C++ ================================================== From the Start menu, choose All Programs -> Microsoft Visual Studio 2005 (folder, not the shortcut) -> Visual Studio Tools -> Visual Studio 2005 Command Prompt To compile and link a .cpp file into an .exe: cl /EHsc HelloCruelWorld.cpp (creates HelloCruelWorld.obj and HelloCruelWorld.exe) Compile errors are normally displayed in the Command Prompt window. To save them, cl /EHsc HelloCruelWorld.cpp 2> errors.txt notepad errors.txt --- To clean and zip your project. From Visual Studio 2005, from the Build menu, choose Project Only -> Clean Only ___, where ___ is your solution/project name. From the File menu, choose Save All. Again from the File menu, choose Close Project. Open a Command Prompt window. cd to the directory where you have saved your solution/project. For example, if your working folder right off C drive is called "ctec1335": c: to switch to C drive (not necessary if your prompt says you are already on C drive) cd \ctec1335 to change to the \ctec1335 folder cd into the solution folder For example, if your solution/project is called "Lab1": cd Lab1 Remove the "debug" folder rd /s /q debug Delete the .ncb file del /f /q *.ncb cd into the project folder. Typically, the project and solution are named the same. For example, cd Lab1 Remove the "Debug" folder rd /s /q Debug Delete any .obj and .exe files that may have not been cleaned. del /f /q *.obj del /f /q *.exe You should be left with four files and two folders, the .sln file in your solution folder the two .vcproj files in your project subfolder the .cpp file in your project subfolder --- To zip, download the InfoZip ZIP for Windows program (zip.exe) from the course web site, and save it in your working directory on the hard drive (C:). From the Command prompt, make sure that you have cleaned your project first (as described above.) zip -r9 solution.zip solution-folder where solution.zip is the name of the .zip file and solution-folder is the name of your solution/project folder. Using the above example: c: cd \work zip -r9 Lab1.zip Lab1 You can then copy the .zip file to your USB flash drive or to your network drive. For example, copy Lab1.zip e:\ctec1335 (assumes that E is the drive letter of your USB flash drive and that there is a folder there called "ctec1335") --- To Unzip An Existing Solution/Project ===================================== Create a folder on the hard disk (C drive) where you can work. The hard disk is typically the fastest storage available and is much faster than both a network share drive and a USB flash drive. For example, from a Command Prompt window: c: change to C drive cd \ change to the root directory on C drive md work create a new folder called "work", right off the root of C drive cd work change to the new "work" folder Download the InfoZip UNZIP for Windows (unzip.exe) from the course web site to your working folder. Either download the .zip file (for example, from the course web site), or copy it from your USB flash drive or network drive. For example, if your network drive is U drive, and you have a folder there called "CTEC 1335 Computer Programming I" and in there is a .zip file called "Lab 1, Part B, Problem #6.zip": unzip -aou "U:\CTEC 1335 Computer Programming I\Lab 1, Part B, Problem #6.zip" It will recreate the solution/project folders and extract the .sln, .vcproj, and .cpp files. Start Visual Studio 2005 and from the File menu, choose Open, then Project/Solution and look for the .sln file.