Hello Everyone

Currently, I am using system("dir") method to call system calls.
I want to know any other method for system calls in VC++ 2008.
How can I call system call in VC++2008 without using system(" ") method?

Any help would be appreciated
Thanks

Recommended Answers

All 5 Replies

Never use system()
Just use kernel or user apis.

Can you please give some examples of kernel or user APIs ?

how can i write system("dir") to kernel or user API level?

Thanks

ShellExecute is a Windows kernal api for doing what you are asking.

Each OS will have a different way of doing things so expect to use #ifdef/#endif pairs if cross-platform support is ever needed.

Thanks Celdecea

ShellExecute works similarly

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.