Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2611
  • Last Modified:

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

0
dotnet4rookie
Asked:
dotnet4rookie
  • 2
  • 2
1 Solution
 
anarki_jimbelCommented:
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
0
 
dotnet4rookieAuthor Commented:
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

0
 
anarki_jimbelCommented:
Sorry, no idea.

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now