如何将bat文件关联到Windows 11中VS 2022的x64本机工具命令提示符?

2lpgd968  于 2023-10-22  发布在  Windows
关注(0)|答案(1)|浏览(208)

下面的链接

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2022\Visual Studio Tools\VC\x64 Native Tools Command Prompt for VS 2022.lnk

特性如下:

Target: %comspec% /k "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
Open File Localtion: C:\Windows\System32\cmd.exe

如何将bat文件的双击行为从“cmd”更改为“x64 Native Tools Command Prompt for VS 2022”以使用graalvm功能(如native-image)?

ivqmmu1c

ivqmmu1c1#

正如@GregHNZ回答的那样,下面是一个示例bat文件内容,可以通过doubleclick调用

call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
native-image -H:ConfigurationFileDirectories=config -march=compatibility --enable-url-protocols=http,https --enable-preview --add-modules jdk.incubator.vector -jar target\com.tugalsan.gvm.vnc.web-1.0-SNAPSHOT-jar-with-dependencies.jar com.tugalsan.gvm.vnc.web

相关问题