#include #include #include #include int main(int argc, char ** argv) { if(argc < 2) return -1; char file[MAX_PATH]; char path[MAX_PATH]; strcpy(file, argv[1]); int iLength = strlen(file); file[iLength - 6] = 0; iLength = iLength - 6; int iSlash = 0; int i=0; for(i=(iLength-1);i>=0;i--) { if(file[i] == '\\') { iSlash = i; break; } //update the location of our slash } char szNewFile[MAX_PATH]; for(i=0;i<((iLength-1)-iSlash);i++) { szNewFile[i] = file[i+iSlash+1]; } szNewFile[i]=0; // Add null terminator. for(i=0;i