home bbs files messages ]

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

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

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

   Message 42,407 of 42,547   
   JJ to Oliver   
   Re: How do you remove ampersand from a W   
   16 Nov 24 19:10:21   
   
   XPost: alt.comp.os.windows-10, rec.photo.digital   
   From: jj4public@outlook.com   
      
   On Fri, 15 Nov 2024 22:42:02 -0700, Oliver wrote:   
   > How do you remove the ampersand from the batch file user input?   
   >   
   ...   
   >   
   > How can I convert the ampersand to the word "and" in the batch output?   
      
   When prompting for a line input, instead of doing it like below...   
      
   set /p item="ITEM: "   
      
   Be accustomed of doing it like below instead.   
      
   set /p "item=ITEM: "   
      
   And when setting a variable, instead of doing it like below...   
      
   set dirname="%today% %brand% %item% %asin%"   
      
   Do it like below instead.   
      
   set "dirname=%today% %brand% %item% %asin%"   
      
   To replace all "&" characters with "and", do it like below - after the   
   variable has been populated.   
      
   set "item=%item:&=and%"   
      
   Type `set /?` to see the SET command help.   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

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


(c) 1994,  bbs@darkrealms.ca