Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if "!srcpath:~-1"==""" set srcpath=!srcpath:~0,-1!
- set srcpath=%srcpath:"=%
- 1. Add a "? to the end of your string
- 2. Then delete ""? from that string
- 3. Then delete "? from that string
- :: SAMPLE -- Just a trailing quote removed
- set srcpath="c:source path"
- set srcpath=%srcpath%"?
- set srcpath=%srcpath:""?=%
- set srcpath=%srcpath:"?=%
- echo srcpath=%srcpath%
- ::You can use the SAME TRICK to remove a trailing backslash
- SET /P "%SRCPATH=Enter the source path "
- ECHO %SRCPATH%
- ECHO %SRCPATH:"=%
Add Comment
Please, Sign In to add comment