For some reason, this question was closed due to generality. It is, however, a specific question about batch scripting. I have edited to try to make that clearer.
Specifically, I want a batch file to run a command like this today:
start Firefox "http://www.billboard.com/charts/hot-100?chartDate=2012-12-01"
But tomorrow the date will be advanced by one day. That is, tomorrow’s command will look like this:
start Firefox "http://www.billboard.com/charts/hot-100?chartDate=2012-12-02"
I have devised a batch file with these two lines:
set BBURL=start Firefox "http://www.billboard.com/charts/hot-100?chartDate=%date:~10,4%-%date:~4,2%-%date:~7,2%"
echo %BBURL%
These lines give me the command I want, updated each day as shown above. But they don’t actually run the command. So my questions are:
- Is there a better way to do this?
- How can I redirect or execute the "echo %BBURL%" output so that it runs as a command?
- What is the proper syntax if I want to alter the command to specify a date in the past (e.g., same day of the year, but 10 years earlier)?
Can’t you just do: