I need to do this thing with help of macros: 1. compile one *.cpp file 2. do some *.bat action 3. build project. I have recoreded two macros. My macros: Sub MyCompile() DTE.ActiveWindow.Object.GetItem("MySol\MyProj\Source Files\Source.cpp").Select(vsUISelectionType.vsUISelectionTypeSelect) DTE.Windows.Item(Constants.vsWindowKindOutput).Activate() DTE.ExecuteCommand("Build.Compile") End Sub Sub MyBuild() DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Activate() DTE.ActiveWindow.Object.GetItem("MySol\MyProj").Select(vsUISelectionType.vsUISelectionTypeSelect) DTE.ExecuteCommand("ClassViewContextMenus.ClassViewProject.Build") End Sub They are functional when run separately, but when both called from another parent macro: MyCompile() wshShell.Run("aaa.bat", True) MyBuild() Error message box: Command "ClassViewContextMenus.ClassViewProject.Build" is not available It seems that DTE.ExecuteCommand() is run asynchronously and it dont wait for end of compilation and because of Output window is active second MyBuild() macro fails ? What do you recommend ? Peter
[Please do not mail me a copy of your followup] =?Utf-8?B?UGV0ZXI=?= spake the secret code thusly: >What do you recommend ? Run the batch file as a post-build event for the project or as a post-build step for the cpp file. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>