最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

shell - How to use VS2022 ${workspaceRoot} in Developer Command Prompt For VS 2022 Window - Stack Overflow

programmeradmin2浏览0评论

I am Using VS 2022 for cross-platform development of Linux executables, with compilation/linking occurring on a Linux server.

I have CMakeSettings.json configured to Copy build output back to the local machine, where local machine is Windows10 running VS 2022.

The back copied build output files are at: C:\Users\<UserId>\CMakeBuild\${workspaceHash}\build\Linux-Debug.

For local workflow reasons I want to use Command Prompt Window (or PowerShell window) shell scripts or batch files to copy files around. For example:

copy C:\Users\<UserId>\CMakeBuild\${workspaceRoot}\build\Linux-Debug\*.* c:\Temp\Example\*

So, questions:

  1. How does Command Prompt Window access/expand ${workspaceRoot}? I tried copying ${workspaceRoot} into a command, that doesn't work.
  2. Is there some way for Command Prompt Window to get the value of ? I'm trying to develop scripts usable by several people, all with different UserIds. I'd rather not have them enter their UserId as a script parameter if I can avoid it.
  3. What is a construct like ${variableName} called?

Part of my problem here is I don't know the proper vocabulary for some of this, so it's hard to find the answer.

The results I got were: dir C:\Users\UserId\CMakeBuilds\${workspaceRoot} yields File Not Found

dir C:\Users\UserId\CMakeBuilds\%workspaceHash% yields File Not Found

dir C:\Users\UserId\CMakeBuilds\guid string yields folder contents

I don't want users having to enter a UserId or guid into the path string. I want that data automatically inserted into the path string.

发布评论

评论列表(0)

  1. 暂无评论