Search found 5 matches

by bosekamineni
05 Feb 2019 11:22
Forum: DOS Batch Forum
Topic: I need to escape pipe character in a string but still remove leading and trailing quotes
Replies: 6
Views: 873

Re: I need to escape pipe character in a string but still remove leading and trailing quotes

I tried :addv @rem set the params to the entire set because quotations causes windows to expand the value and split it up setlocal EnableDelayedExpansion set "_params=%*" It does not delay the parsing and it fails call :addv "cliqrWindowsPassword=U2h|ocom5=fd.jgz" setlocal EnableDelayedExpansion set...
by bosekamineni
05 Feb 2019 11:12
Forum: DOS Batch Forum
Topic: I need to escape pipe character in a string but still remove leading and trailing quotes
Replies: 6
Views: 873

Re: I need to escape pipe character in a string but still remove leading and trailing quotes

Jeb Thank you- I tested your code and I tried to include in the script where I was having issues existing code - :addv @rem set the params to the entire set because quotations causes windows to expand the value and split it up @rem setlocal EnableDelayedExpansion set "_params=%*" @rem strip the wrap...
by bosekamineni
05 Feb 2019 01:40
Forum: DOS Batch Forum
Topic: I need to escape pipe character in a string but still remove leading and trailing quotes
Replies: 6
Views: 873

Re: I need to escape pipe character in a string but still remove leading and trailing quotes

set "_string=%_string:~1,-1%"

did not escape the special character |
any other ideas would be helpful
by bosekamineni
04 Feb 2019 15:51
Forum: DOS Batch Forum
Topic: I need to escape pipe character in a string but still remove leading and trailing quotes
Replies: 6
Views: 873

Re: I need to escape pipe character in a string but still remove leading and trailing quotes

@echo off set _string="Test String With command" echo the string is %_string% set "_string=%_string:~1,-1%" echo the string is %_string% when there is no special character it works the string is "Test String With command" the string is Test String With command set _string="Test String With |command"...
by bosekamineni
04 Feb 2019 12:16
Forum: DOS Batch Forum
Topic: I need to escape pipe character in a string but still remove leading and trailing quotes
Replies: 6
Views: 873

I need to escape pipe character in a string but still remove leading and trailing quotes

@echo on set _string="Test String With command" echo the string is %_string% set _string=%_string:~1,-1% echo the string is %_string% set _string="Test String With |command" set _string=%_string:~1,-1% echo the string is %_string% if I do not use escape then after executing the statement set _string...