title: Remove the parent directory name from the echo %cd% command
body: <p>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 <strong>remove the string after last "\"</strong>. Anyone know how to do this in windows <strong>commandline(cmd)</strong></p>