set "path=C:\Windows\System32\regsvr32.exe" if "%path%:~-1" EQU "\" set "path=%path:~0,-1%" echo %path% pause
@echo off setlocal enabledelayedexpansion enableextensions set myPath=C:\efi\Boot\bootx64.efi call :file_name_from_path result !myPath! echo %result% goto :eof :file_name_from_path <resultVar> <pathVar> ( set "%~1=%~dp1" exit /b ) :eof endlocal
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)