Remove Trailing Backslashes from (ItemDir) in External Tools

Nathan Sokalski 4,111 Reputation points
2021-02-19T03:36:41.17+00:00

In my External Tools... I have a command with $(ItemDir) in the Arguments field. I want this to return the directory of the item without any trailing backslashes for filename, like the following:
D:\AppForms\SP1_Forms\SP1_Forms
However, it is including an extra backslash & double quote like the following:
D:\AppForms\SP1_Forms\SP1_Forms\"
How can I avoid the trailing \" ?

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.

Locked Question. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

Answer accepted by question author
Viorel 127.3K Reputation points
2021-02-19T07:26:05.433+00:00

Maybe adding a '.' after $(ItemDir) will also work:

$(ItemDir).

This will probably generate "D:\AppForms\SP1_Forms\SP1_Forms\.", which is equivalent to "D:\AppForms\SP1_Forms\SP1_Forms".

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Dylan Zhu-MSFT 6,436 Reputation points
    2021-02-19T06:55:20.277+00:00

    Hi njsokalski,

    You can try to type this command: "$(ItemDir)".

    Best Regards, Dylan

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our * *documentation* to enable e-mail notifications if you want to receive the related email notification for this thread.**

    Was this answer helpful?

    0 comments No comments