Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- SetLocal DisableDelayedExpansion
- For /F %%# In ('"Prompt;$H&For %%# in (1) Do Rem"') Do Set "BS=%%#"
- Set "Line="
- <Nul set/p="%~2"
- :HILoop
- Set "Key="
- For /F "delims=" %%# In (
- 'Xcopy /L /W "%~f0" "%~f0" 2^>Nul'
- ) Do If Not Defined Key Set "Key=%%#"
- Set "key=%Key:~-1%"
- SetLocal EnableDelayedExpansion
- If Not Defined Key Goto :HIEnd
- rem If ^"==^%Key% Set "Key=0x22"
- If %BS%==^%Key% (
- Set /P "=%BS% %BS%" <Nul
- Set "Key="
- If Defined Line set/a length-=1& Set "Line=!Line:~0,-1!"
- ) Else set/a length+=1&Set /P "=*" <Nul
- If Not Defined Line (
- EndLocal& Set/a length=1& Set "Line=%key%"
- ) Else For /F delims^=^ eol^= %%# In ("!Line!") Do (
- EndLocal& Set/a length=%length%& Set "Line=%%#%Key%"
- )
- Goto :HILoop
- :HIEnd
- if not defined Line set/a length=0
- echo(
- if not "%~1"=="" (
- For /F delims^=^ eol^= %%# In ("!Line!") Do (
- EndLocal&EndLocal&(If not "%~3"=="" Set "%~3=%length%")& Set "%~1=%%#" %length
- )
- ) Else (
- For /F delims^=^ eol^= %%# In ("!Line!") Do (
- EndLocal&EndLocal&(If not "%~3"=="" set "%~3=%length%")& Set "Pass=%%#" %length
- )
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement