I know it will sound weird at first, but I am trying to make a sort of wrapper around the Windows Command Prompt. The reason for this being that my school blocks windows' Command Prompt (and for good reason, some of the kids don't know squat about computers, and could really screw things up).

Here's what I have so far:

Code:
/*

Wrapper around the microsoft terminal.

Useful for when shell work is not available or disabled.

*/



// Includes start here...

#include <windows.h>

#include <stdlib.h>

#include <iostream>

#include <string>

// Includes end here...



// Tell that were gonna use some namespaces here...

using namespace std;



int main()

{

	bool 		quit 		= false;

	string 		cwd         = "> ";

	string      quitstr1    = "quit";

	string      quitstr2    = "Quit";

	string		gettext;



	// Lets get the user name for nice display at the start of each line...

    char        currentuser[50];

    DWORD       ncurrentuser   = sizeof(currentuser);



    GetUserName(currentuser, &ncurrentuser);



    start:



	while(quit == false)

	{

		gettext = "";

		cout	<< currentuser << cwd;

		cin		>> gettext;

		cin.ignore();



        if(gettext == quitstr1 || gettext == quitstr2)

        {

            quit = true;

            goto start;

        }



		system(gettext.c_str());

	}



	return 0;

}
I know this isn't quite the best solution, but it is a quick hack-up that will hopefully work when I try and use portable gcc at the schools computers (among other things that need the terminal).

My question is...

I want to give the program the ability to use the cd command. And what I'm thinking for this, is just to see if the user inputted 'cd C:\whatever', like I did with quit. Problem is, how to I just collect the first two characters, to see if it's 'cd'? And even if I do this, how to I collect everything after the third character (everything after 'cd<space>')? If I can just do this, I'll be able to append that path to './whatever.txt' files, so that the user doesn't always have to use full path names.

Thanks so much!
FlyingIsFun1217