Here is a requirement:
The user is asked to input a path, the batch program reads that path and concatenates it with the relative path defined in the batch, so problems like the following may be encountered:
@echo off
set log=\err.log
set /p installoc=please input the path of utility installation location:
pushd %installoc% 2>nul
popd
set a_path=%installoc%%log%
echo The path of log file is %a_path%
If the user inputs c:\utility\,
then a_path becomes c:\utility\\err.log. Please note that there will be two \\ here. How can this absolute path be normalized so that the output is c:\utility\err.log,
Thanks, still learning....
The user is asked to input a path, the batch program reads that path and concatenates it with the relative path defined in the batch, so problems like the following may be encountered:
@echo off
set log=\err.log
set /p installoc=please input the path of utility installation location:
pushd %installoc% 2>nul
popd
set a_path=%installoc%%log%
echo The path of log file is %a_path%
If the user inputs c:\utility\,
then a_path becomes c:\utility\\err.log. Please note that there will be two \\ here. How can this absolute path be normalized so that the output is c:\utility\err.log,
Thanks, still learning....
