orange_batch wrote:No need to get nasty.It depends on what you're doing, but such things may make a difference when processing large amounts of data. For example, using find/findstr to find a substring in a single line must be around a hundred times slower than doing a native substring replace and comparison.
you are right. The code posted by amel27 need high performances, a simple CD need human-time performance, it could be relatively slow. You can see a 'time cost' if in a batch use CDD many times, I never run in trouble.
My approach to the problem was wrong, I try to do something with wrong method. Now I found a way to aliasing commands so no need to wrap the command line in a batch and parse commands (or in the worst case to rewrite a shell).
I have a command line initialization batch file (see as an autoexec.bat) when opening a cmd.exe section, the aliases go there. I also added
Code: Select all
DosKey ..=cd ..
it works with my surprise.
This site has lots of useful dos tips (as the domain suggests), you and many others on this forums are advanced batch programmers, for that reason I asked for a solution but, as I sayd, my approach to the problem was wrong.
Have fun.