You can run the following JScript example on the command line to upgrade one or more Visual C + + 6.0 projects.
When running this in the command line,
Call it with CScript so don ' t get UI.
Example:cscript convert.js E:\YOURPROJECTS\OLD.DSP e:\yourprojects\new.vcproj
Note:full path required to both input and output files
or set default script engine to the command line doing this a
Example:cscript//H:CScript
Once you are set the environment, run the. js file like a. bat file
To have a batch file loop through all the. dsp files
In a directory, write a batch file "looked like this"
(Windows NT 4 or Windows only)
CScript//H:CScript//nologo
FOR/R%%i in (*.DSP) do convert.js%%i >> \convert.log
var vcProj = new ActiveXObject ("visualstudio.vcprojectengine.8.0");
var objfile = new ActiveXObject ("Scripting.FileSystemObject");
var objargs = wscript.arguments;
Check the arguments to is sure it ' s right
if (Objargs.count () < 2)
{
WScript.Echo ("VC6 or 5 DSP Project File conversion");
WScript.Echo ("opens specified. DSP and converts to VC8 Format.");
WScript.Echo ("would create project file with. vcproj extension");
WScript.Echo ("\n\tusage: <full path\project.dsp> <full path\project.vcproj>");
Wscript.Quit (1);
}
WScript.Echo ("\nconverting:" + objargs.item (0));
If There is a file name of the. vcproj extension, does not convert
var vcproject = vcproj.loadproject (Objargs.item (0));
if (!objfile.fileexists (vcproject.projectfile))
{
Specify name and location of new project file
Vcproject.projectfile = Objargs.item (1);
Call the project engine to save.
When no name is shown, it would create one with the. vcproj Name
Vcproject.save ();
WScript.Echo ("New Project Name:" +vcproject.projectfile+ "\ n");
}
Else
{
WScript.Echo ("error!:" +vcproject.projectfile+ "already exists!\n");
}