The following command works fine. It opens a new instance of Visual Studio 2010:
devenv
But if I specify a file name, Visual Studio's window layout will be reset.
devenv "D:\Temp\test.txt"
Any ideas? Thanks.
Update:
This command works:
devenv /command "open D:\Temp\test.txt"
But the file path cannot contain spaces. The following command give开发者_C百科s an error: "The operation cannot be completed. The system cannot find the file specified":
devenv /command "open D:\Temp\test 2.txt"
I tried:
devenv /command "open 'D:\Temp\test 2.txt'"
But got the same error.
OK I think understand now.
Visual Studio uses different layouts for different situations. It uses a special layout when it is opened from command line with a specified file name.
I have never custom this layout so it looks like the default one, made me thought the layout was reset.
精彩评论