SWAG98

create_string function

Mar 7th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.33 KB | None | 0 0
  1. @echo off
  2.  
  3. set string=%2
  4. set /a takeaway=5
  5.  
  6. for /f "usebackq tokens=*" %%a in ('%string%') do (
  7.    
  8.     if %string% equ %%~a (
  9.         set /a takeaway=3
  10.     )
  11.  
  12.     set string=%%~a
  13. )
  14.  
  15. echo %2 > %TEMP%\tempfile.txt
  16.  
  17. for %%g in ( %TEMP%\tempfile.txt ) do (
  18.     set /a %1_lenght=%%~zg - %takeaway%
  19. )
  20. del %TEMP%\tempfile.txt
  21. set %1=%string%
Add Comment
Please, Sign In to add comment