Hi, I am using a 16-bit compliler and i wanted to execute a dos commmand through c++ using system() command.I wrote the following code but it didn't help

#include<process.h>
void main()
{
  system("c:\\windows\\system32\\Notepad");
}

I even tried wid 'system("notepad")' but even tht didn't run the command.Plz tell me if i am going wrong anywhere...

Hi, I am using a 16-bit compliler and i wanted to execute a dos commmand through c++ using system() command.I wrote the following code but it didn't help


#include<process.h>
void main()
{
system("c:\\windows\\system32\\Notepad");
}

I even tried wid 'system("notepad")' but even tht didn't run the command.Plz tell me if i am going wrong anywhere...

16 bit compiler? DOS command? What operating system does your computer use? If your computer is running a modern Operating System and there's no need to use DOS and a 16 bit compiler, I'd ditch them and get a more recent one.

You can't call any MS-Windows programs (such as Notepad.exe) from a 16-bit compiler because the compiler doesn't know how to do that.

Probably u need to have headerfile <dos.h>

#include<dos.h>

void main()
{
     system("c:\");
}
commented: Far too late to be of any use to the OP -4

The system() command can't find Notepad. I'll bet it could find Notepad.exe though...

16 bit compiler?

Turbo C probably...

DOS command?

cmd.exe -- console. Many people still think of it as DOS.

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.