Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

system() function is not working

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
When I used the function system() to execute DOS commands
It is not working y?
 

Which platform are you working, Windows/DOS ?
Why dont you post the code.It would be helpful to all.

abp
 
what is the function's return value? error code?

maybe you should consider using spawn*() instead?
 
Try to execute the .exe of your program. ie compile your program and create an executable file and run it. Sometime, running the dos commands within the IDE through C/C++ may not work.

Maniraja S
 
Some system are not working because the parameter you pass to function is system dependent. For example system("clear") work under Linux, but not under DOS, because DOS doesn't have command clear. Its analog in DOS is cls, but system("cls") work under DOS but doesn't work under Linux because of the same. John Fill
1c.bmp


ivfmd@mail.md
 
The system() function works well when you call internal commands, like dir, mk, etc.

If you want call other type of commands try ShellExecute().

Hope this help. Sorry about my bad english.

Jorge Carvalho
From the Sun of Portugal
 
go to Option then go to Debugger then
change the Program Heap Size from 64k to 640k.
it works on my computer should work on yours too.

oneuman@netvisions.net.il
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top