hhr
hhr

Reputation: 1

How do I open a Firefox page with batch, and setting the link based on a text file's text?

I've spent at least two hours guessing and looking around google for a way to do this. I got this far:

set A = C: \Users\Owner\Desktop\OutputFiles\LinkToHat.txt
start firefox A

I'm trying to open firefox with the website being the link that is inside the LinkToHat.txt file. I only know Lua, so I figured it would load the variable's value, rather than the website "A". Thanks

Upvotes: 0

Views: 1528

Answers (1)

Ron Lau
Ron Lau

Reputation: 159

Accessing a "set" variable needs the variable name surrounded by '%'s, e.g. %A%.

set A=C:\Users\Owner\Desktop\OutputFiles\LinkToHat.txt
start firefox "%A%"

Double quotes are added to prevent problems incur by spaces in the variable. (No problem now but you may have a URL with spaces assigned to A later)

Upvotes: 1

Related Questions