Created
November 29, 2020 04:57
-
-
Save lablnet/986278fd13f80e9d6f2586799c573abb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SetLocal DisableDelayedExpansion | |
Set "Line=" | |
For /F %%# In ('"Prompt;$H & For %%# in (1) Do Rem"') Do ( | |
Set "BS=%%#" | |
) | |
:loop_start | |
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 :loop_end | |
) | |
If %BS%==^%Key% ( | |
Set "Key=" | |
If Defined Line ( | |
Set "Line=!Line:~0,-1!" | |
) | |
) | |
If Not Defined Line ( | |
EndLocal | |
Set "Line=%Key%" | |
) Else ( | |
For /F "delims=" %%# In ("!Line!") Do ( | |
EndLocal | |
Set "Line=%%#%Key%" | |
) | |
) | |
Goto :loop_start | |
:loop_end | |
Echo;!Line! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment