0

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...

5
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by WaltP
0

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.

0

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.

-1

Probably u need to have headerfile <dos.h>

#include<dos.h>

void main()
{
     system("c:\");
}

Edited by Nick Evan: Added code-tags

Comments
Far too late to be of any use to the OP
0

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.

Edited by WaltP: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.