07-23-2023, 09:07 AM
I need to take two strings and combine them into a single path string inside a batch file similar to the Path.Combine method in .NET. For example, whether the strings are "C:\trunk" and "ProjectName\Project.txt" or "C:\trunk\" and "ProjectName\Project.txt", the combined path will be "C:\trunk\ProjectName\Project.txt".
I have tried using PowerShell's join-path command which works, but I need a way to pass this value back to the batch file. I tried using environment variables for that, but I wasn't successful. One option for me is to move all that code into a PowerShell script and avoid the batch file altogether. However, if I had to do it within the batch file, how would I do it?
I have tried using PowerShell's join-path command which works, but I need a way to pass this value back to the batch file. I tried using environment variables for that, but I wasn't successful. One option for me is to move all that code into a PowerShell script and avoid the batch file altogether. However, if I had to do it within the batch file, how would I do it?