Closing a VS Dev Window

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
lmstearn
Posts: 50
Joined: 07 Dec 2014 15:15
Location: Australia
Contact:

Closing a VS Dev Window

#1 Post by lmstearn » 24 Sep 2015 07:28

Hi there,
By the invocation of a small batch file in the window would be it necessary to get a PID for the parent window or is there an "easier" way?
Thanks

Edit: Well there is, re this post use the following command to set the dev environment:

Code: Select all

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
Last edited by lmstearn on 25 Sep 2015 04:30, edited 1 time in total.

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Closing a VS Dev Window

#2 Post by ShadowThief » 25 Sep 2015 00:36

I'm not entirely sure what you're asking. Can you please provide an example?

lmstearn
Posts: 50
Joined: 07 Dec 2014 15:15
Location: Australia
Contact:

Re: Closing a VS Dev Window

#3 Post by lmstearn » 25 Sep 2015 05:23

@ShadowThief: Starting a dev cmd prompt and running some commands. if another batch file is called within the dev cmd window, it is a rather awkward task (pour moi) to close the dev window. e.g.

Code: Select all

Start dev cmd prompt
Run my.bat in the shell
my.bat completes execution
dev cmd window is still open- we want it begone when my.bat returns


But with the OP edit, the dev environment can be invoked in any batch file.

Suppose then we create a batch file with the name "devbat.bat". In light of the note from MSDN:

Several command-line tools or tool options require Administrator permission. To use them, we recommend that you open a Command Prompt window by using the Run as Administrator option (on the shortcut menu for the Command Prompt window you want to open).

should the first part of Dos_Probie's code go before or after

Code: Select all

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
?

Off topic: Is it the case that upon disabling jscript code in the web browser, it still compiles when invoked from devbat.bat?

Edit: _Dos_Probie's code won't work here as "conditional compilation is turned off". Where does the "/*@cc_on @*/" go?

Post Reply