home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,970 of 68,980   
   Herbert Kleebauer to R.Wieser   
   Re: echo a variable containing an & some   
   20 Nov 22 19:54:56   
   
   From: klee@unibwm.de   
      
   On 20.11.2022 12:48, R.Wieser wrote:   
   > Hello all,   
      
   > I know that I can wrap it in doublequotes :   
   >   
   > echo "%~xn1"   
   >   
   > but those doublequotes get displayed too. :-(   
      
   I don't know how to get a & in %1 without surrounding it   
   in "" so I can't test it. But set/p seems to remove the "":   
      
   @echo off   
      
   call :sub "d:\a&b\c\te&st.123"   
   goto :eof   
      
   :sub   
   echo %1   
   set /p a="%~xn1"

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca