创建的批处理文件:
@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
需求 : 我想用给定的
%pass%
打开 URL字符串,在每个循环中,我想从字符串中删除最后一个字符,直到 URL 保留一个字符。例子:
1st url : https://xxx.xxx/xxx/45454545854545854254545454
2nd url : https://xxx.xxx/xxx/4545454585454585425454545
.......
last url : https://xxx.xxx/xxx/4
最佳答案
您可以使用更少的代码来完成此操作。
@echo off
Set "Pass=45454545854545854254545454"
:loop
echo https://xxx.xxx/xxx/%pass%
set "pass=%pass:~0,-1%"
IF DEFINED pass GOTO loop
关于batch-file - 打开带有给定字符串的 URL |在每次 URL 运行时从字符串中去除一个字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53766945/