We know that echo %cd% command print working directory, Assume that it is “C:\test\bin\run” I want to know how to remove “run” from the string. second time “run” directory can be “stop” directory. therefore we can’t use string replace command. what is I think to do is remove the string after last “\”. Anyone know how to do this in windows commandline(cmd)
We know that echo %cd% command print working directory, Assume that it is C:\test\bin\run
Share
If it’s okay to change dirs during the process how about: