Windows Command in C++

F

farshad

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
 
M

Moonlit

Hi,

Could old dos/unix programming use mkdir().

In windows use CreateDirectory()

Regards, Ron AF Greve.
 
P

Phlip

farshad said:
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.
 
M

Matt S Trentini

Heya,
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,148
Messages
2,570,838
Members
47,385
Latest member
Joneswilliam01

Latest Threads

Top