Hi,

To explain once my app is added to windows path you can simply call it from CMD and you
know how when you run a console it opens up a default folder and you can navigate to a
new on by using cd .. and cd path command. I want to get that path to my app.

Meaning you open CMD, go cd.. cd.. etc to where you want to create a new project say C:\
and once there you just run: create project name and it will create the project in that
directory.

How do i get the path where user using the CMD is at ?

#include <direct.h>
#include <stdlib.h>
#include <stdio.h>

int main( void )
{
   char* buffer;
   buffer = (char*)malloc(sizeof(char)*MAX_PATH) ;
   // Get the current working directory: 
   if( (buffer = _getcwd( NULL, 0 )) == NULL )
      // code to deal with error
   else
   {
      printf( "%s\n",buffer );
      free(buffer);
   }
}

Adapt it to your needs. But use the getcwd function.

Thats a lot that saved me a lot of time i can go and work on the rest of my functions. Um if anyone else tries this just make sure your program name is not conflicting whit another program in ENVIRONMENT VARIABLES -> path

I had to rename mine : )

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.