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 68,797 of 68,980   
   JJ to Anton Shepelev   
   Re: Replacing a character with a percent   
   22 May 24 20:54:39   
   
   From: jj4public@outlook.com   
      
   On Wed, 22 May 2024 15:29:41 +0300, Anton Shepelev wrote:   
   >   
   > I there a way without delayed expansion and file IO?   
      
   You could borrow MSHTA's JScript to do the troublesome work.   
   Caveat: slow and user may notice a flash of MSHTA window.   
   (long line warning; one long FOR command line, then the ECHO line)   
      
   @echo off   
   setlocal   
   set "src=a#b%%c!d#e%%f!g"   
   echo "src=%src%"   
   set dest=   
   for /f "delims=" %%A in ('mshta.exe "javascript:new ActiveXObjec   
   ("scripting.filesystemobject").getstandardstream(1).write("%src%   
   .replace(/#/g,"%%")),close()"') do set "dest=%%A"   
   echo "dest=%dest%"   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

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


(c) 1994,  bbs@darkrealms.ca