By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,898 Members | 2,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,898 IT Pros & Developers. It's quick & easy.

Windows Command in C++

P: n/a
Hello,

Could someone tell me which way can we use windows command(for example
Create New Folder) in visual c++ programing or use dos command without
using dos prompt.

best regards
farshad
Jul 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

Could old dos/unix programming use mkdir().

In windows use CreateDirectory()

Regards, Ron AF Greve.

"farshad" <so******@yahoo.com> wrote in message
news:eb**************************@posting.google.c om...
Hello,

Could someone tell me which way can we use windows command(for example
Create New Folder) in visual c++ programing or use dos command without
using dos prompt.

best regards
farshad

Jul 22 '05 #2

P: n/a
farshad wrote:
Could someone tell me which way can we use windows command(for example
Create New Folder) in visual c++ programing or use dos command without
using dos prompt.


The (non-Standard and off-topic) functions inside <direct.h>, such as
_mkdir(), can make a directory.

The Standard way to run a command prompt is system("mkdir newFolder");

To drive your Win32 Explorer shell as an object you must learn COM, which is
no picnic. Peek at /Visual C++ Windows Shell Programming/ by Dino Esposito
to see how hard it can be.

You really don't need either advanced way; always start with the simple
kernel-level functions first.

--
Phlip
Jul 22 '05 #3

P: n/a
Heya,

farshad wrote:
Could someone tell me which way can we use windows command(for example
Create New Folder) in visual c++ programing or use dos command without
using dos prompt.


The C++ standard doesn't cover these platform-specific issues. However,
if you're wanting to create directories and manipulate files take a look
at boost::filesystem
(http://www.boost.org/libs/filesystem/doc/index.htm). It's very
portable and widely used.

Cheers,
Matt

Jul 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.