Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to make %0 include the full path of the called batch file?

batch called file path
0
Posted

How to make %0 include the full path of the called batch file?

0

Assuming you want to execute TEST.BAT, which is in your path, you could execute %@SEARCH[test] which will yield the desired result when %0 is expanded in your batch. Another way would be to use the internal variable %_batchname, which expands to the full path and filename of the current batch.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123