Created batch file:
@Echo off&SetLocal EnableExtensions EnableDelayedExpansion
set execute counter=0
Set "Pass=45454545854545854254545454"
Echo Password is:%Pass%
start "" https://xxx.xxx/xxx/%pass%
:test
set "Pass=%Pass%"
set "Pass=!Pass:~1,-1!
echo Password is :%Pass%
start "" https://xxx.xxx/xxx/%pass%
goto test
Requirements: I want to open URL with given %pass%
string, on each loop I want to strip the last character from string until one character will remain for URL.
Example:
1st url : https://xxx.xxx/xxx/45454545854545854254545454
2nd url : https://xxx.xxx/xxx/4545454585454585425454545
.......
last url : https://xxx.xxx/xxx/4
You can accomplish this with much less code.
@echo off
Set "Pass=45454545854545854254545454"
:loop
echo https://xxx.xxx/xxx/%pass%
set "pass=%pass:~0,-1%"
IF DEFINED pass GOTO loop
Here is a possible solution:
@echo off
Setlocal EnableExtensions EnableDelayedExpansion
set "execute counter=0"
Set "Pass=45454545854545854254545454"
Echo Password is: %Pass%
start "" https://xxx.xxx/xxx/%pass%
goto test
:test
set "Pass=!Pass:~0,-1!"
if defined Pass (
echo Password is: !Pass!
start "" https://xxx.xxx/xxx/!pass!
rem pause
rem Add pause not to overload your computer!
goto test
) else (
echo No more characters to strip!
pause
exit /b
)
I have quoted execute counter
variable in set
to avoid any strange behaviours. Added a goto test
after the end of main code (not really needed).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With