Problem in For command [SOLVED]

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Problem in For command [SOLVED]

#1 Post by abc0502 » 28 Aug 2012 03:56

I'm using wget.exe to download pages from range 1 to 5
so i made this command

html names are like this "page@offset=1.html" and "page@offset=2.html" the number only change

Code: Select all

@echo off
cls
set "filename=page@offset="
set "location=D:\data"

For /L %%a (1,1,5) Do (
     IF not exist "%location%\%filename%%%a.html" ( wget command here to download )
)


I have no idea why it refuse to work, i used setlocal and removed it and same output
page@offset=%a.html
page@offset=%a.html
page@offset=%a.html
page@offset=%a.html
page@offset=%a.html


why ??? :?:
Last edited by abc0502 on 28 Aug 2012 04:47, edited 1 time in total.

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Problem in For command

#2 Post by abc0502 » 28 Aug 2012 04:18

I have no Idea what is happening , but this same code works :roll: :? now. ???

Post Reply