开发者

Visual studio postbuild - changing to the solution drive

In Visual Studio postbuild, 开发者_Python百科I need to run a batch file. The solution is potentially on a different drive to that which Visual Studio is running from. In postbuild, how do I determine the drive letter that the solution is running from so I can change to that drive before running the batch file? At the moment, all I have is this:

CD $(ProjectDir)
$(ProjectDir)postbuild.bat

The problem is that changing directory when that directory is on a different drive does not change the current directory, as you have to manually change which drive you're on, e.g. like so:

E:\
CD $(ProjectDir)
$(ProjectDir)postbuild.bat

I can't guarantee what drive the solution is going to be on though, so I need to determine the drive via some kind of macro to ensure the postbuild.bat file will run from the currect location.


CD /D $(ProjectDir)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜