A "Build Workspace" menu command for Windows Explorer

Sample Image

What does it do?

As you may have noticed, this macro implements an action for Project Workspaces besides the default one (Open with MSDEV). The purpose of this macro is to allow you to do a background build of a selected configuration from the selected workspace. A Developer Studio instance is created invisible and starts compiling the workspace, after which it quits.

How to use it?

This code was developed and tested with Visual C++ 6.0 SP3 and WinNT 4.0 SP4. It requires Windows Scripting Host 5.0 available Microsoft at http//www.microsoft.com/msdownload/vbscript/scripting.asp.

There are two flags you can use with the script

Flag Description

-Rebuild[Configuration hint]
Activates the Rebuild All mode, and optionally, hints the script to which configuration to use.
-BuildConfiguration hint
Hints the script to which configuration to use.

The configuration hint is a substring of a project configuration name. For example, if you have the following configurations in your project

  • Win32 Debug;
  • Win32 Debug Unicode;
  • Win32 Release; and
  • Win32 Release Unicode.

and you pass "Release", the script will build Win32 Release. It selects the shortest name that contains the desired string.

Finally, to install it

Edit the .reg file and replace C\\Program Files\\Microsoft Visual Studio\\Common\\IDE\\build.vbs for the actual path you will be using. In my case, I have put the script file in a shared directory alongside with the .reg so that anyone has access to the latest version of the script. Anyone that wishes to install this feature just has to execute the .reg file.


REGEDIT4

[HKEY_CLASSES_ROOT\dswfile\shell\Build_Workspace]
"EditFlags"=hex01,00,00,00
@="Build Workspace"

[HKEY_CLASSES_ROOT\dswfile\shell\Build_Workspace\command]
@="wscript.exe \\build.vbs \"%1\""

Downloads

Download source - 2 Kb

History



Comments

  • Same problem Here

    Posted by Legacy on 11/30/1999 12:00am

    Originally posted by: Waseem Anis

    I have the same problem Cris is facing. I get error box on line 28. Using VC6/SP3.
    

    Reply
  • Some Problems

    Posted by Legacy on 09/29/1999 12:00am

    Originally posted by: Trivikram Bhat

    I tried the script and when I right click on the workspace file(.dsw), I get the option to Build with MsDev but on selecting that option, it gives the following message.

    Could not find application. Click on My Computer open it and choose View/Options to create an asssociation.

    Please let me know
    Thanks
    Triv.

    Reply
  • Line 28 Error

    Posted by Legacy on 07/05/1999 12:00am

    Originally posted by: Cris Padilla Tagle

    It is a good idea. However, it didn't work in my apps. I tried it and the script returned an error in line 28. I already have downloaded the latest WSH. What seems to be the problem?

    Thanks anyway and thanks in advance for the answers.

    Reply
  • Nice idea :)

    Posted by Legacy on 06/21/1999 12:00am

    Originally posted by: Anton Bazarsky

    I like it. I'd liked it even more if there was an option to set some additional parameters for building.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • Live Event Date: November 13, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT APIs can be a great source of competitive advantage. The practice of exposing backend services as APIs has become pervasive, however their use varies widely across companies and industries. Some companies leverage APIs to create internal, operational and development efficiencies, while others use them to drive ancillary revenue channels. Many companies successfully support both public and private programs from the same API by varying levels …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds