Create a directory using Post build Event in VS 2005

Posted on 2007-07-23
Last Modified: 2013-11-26
I would like to know how to create a Directory for instance a Hello directory in the "C:\Windowsapplication1\Bin\"  using PostBuild event so that we will get "C:\WindowsApplication1\Bin\Hello". I'm already using the Copy command in the PostBuild event to copy contents of the "C:\WindowsApplication1\Windowsapplication1\bin\debug"  to the "C:\WindowsApplication1\Bin" Directory. I'm using VS 2005.


Question by:dotnet4rookie
    LVL 29

    Accepted Solution

    If you can copy folders what is the problem to create a folder?
    Did you try something like :

    mkdir "C:\WindowsApplication1\Bin\Hello"

    in the postbuild event

    Author Comment

    anarki jimbel,

    thanks for the response.

    I want to copy the build files to a already existing folder. Along with this I want to create a folder which I will copy to the already existing folder or create the folder in the already existing folder.

    For instance I have "C:\Windowsapplication1\Bin\"  and I have all my build files in "C:\WindowsApplication1\Windowsapplication1\bin\debug" , I want to be able to create a folder "Hello" straight away in "C:\WindowsApplication1\Bin" or create it in "C:\WindowsApplication1\Windowsapplication1\bin\debug" directory and copy it along with the other build files I will copy to the "C:\Windowsapplication1\Bin\" folder. The folder "C:\Windowsapplication1\Bin\" is already existing.

    All the contents of this folder I should package into a setup program.

    mkdir "C:\WindowsApplication1\Bin\Hello"  does not work.



    LVL 29

    Expert Comment

    Sorry, no idea.

    Basicly what you add to events are DOS commands. Strange it's not working...

    Author Comment

    Anarki Jimbel,

    Yeah, That's what I was of the opinion too....but the first build passes (when there is no directory called Hello at that location) but the second build onwards it fails. I tried removing the directory using the "rd" command and then using "Mkdir" but that would not work.

    But I think I kind of know what to do. I'm going to use "rd" command in the pre build events and the "mkdir" command in the post build event. I tried it now and it works.

    thanks for the help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now