Easy execution of your postbuild events
When working on our larger projects, we use post-build events. One part of the post-build is the dll file, which Visual Studio will handle to copy to the correct location, the other part, all layout, xslt, css, js, images, will be handled by the .bat file copy_with_no_dll.bat.

The problem is when you havn´t changed a .cs file, but only stuff like css, js or html, you would have to build the project, in order to run the copy_with_no_dll.bat. The solution would prior be to locate the .bat file in Windows Explorer, and execute it from there. With the following approach, you can get your Visual Studio to fire the .bat file when you double click it.

 

  1. Open Windows Explorer and navigate to: %userprofile%/Documents/Visual Studio 2010
  2. Create a new file, named ExecuteCmd.cmd
  3. Edit the file and add the following lines @cmd /c %1 @pause
  4. Go to Visual Studio, right click a given .bat file in your solution, and choose "Open With...", Click Add, and navigate to ExecuteCmd.cmd.
  5. Set ExecuteCmd.cmd to default for this kind of file

This will enable that you simply double click the .bat file, to execute it. Very nice, very easy :-)

Source: http://erraticdev.blogspot.com/2010/11/running-batch-files-bat-from-within.html