Link to home
Start Free TrialLog in
Avatar of dotnet4rookie
dotnet4rookie

asked on

Create a directory using Post build Event in VS 2005

Hi,
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.

Thanks

ASKER CERTIFIED SOLUTION
Avatar of Dmitry G
Dmitry G
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dotnet4rookie
dotnet4rookie

ASKER

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.

Thanks,

Priya

Sorry, no idea.

Basicly what you add to events are DOS commands. Strange it's not working...
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.