Page 1 of 1
Running Lynx (text browser) from Batch File?
Posted: 06 Jul 2011 08:59
by Wolf_22
I'm trying to run Lynx in a batch file and I'm able to do it given the batch file itself is in the same directory as Lynx is, however, I want to be able to run the batch file in a different directory and doing so has been problematic...
Here's the code I have in my batch file:
Code:
Code: Select all
lynx -source http://website.com/page.php
In order to run this puppy outside of the Lynx directory, do I have to create an
Environment variable or a
System variable on an XP machine?
Any insight into this is appreciated.
Re: Running Lynx (text browser) from Batch File?
Posted: 06 Jul 2011 12:06
by aGerman
There are different possipilities.
- You could call it with the full name, like:
Code: Select all
call "C:\way\to\lynx\lynx.exe" -source http://website.com/page.php
- You could temporary extend the %path% environment variable (only for the current batch file):
Code: Select all
set "path=C:\way\to\lynx;%path%"
lynx -source http://website.com/page.php
-You could permanently extend the %path% environment variable
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sysdm_advancd_environmnt_addchange_variable.mspx?mfr=trueRegards
aGerman
Re: Running Lynx (text browser) from Batch File?
Posted: 06 Jul 2011 12:26
by Wolf_22
Thanks for the reply, aGerman.
The first method you suggested made Lynx throw an error of the following:
Configuration file ./lynx.cfg is not available.
The second method threw the following error:
'lynx' is not recognized as an internal or external command, operable program or batch file.
This version of Lynx that I'm using can be found
here. It's the old, stable version toward the bottom.
I've also tried to change the Environment / System variables with the following values:
C:\...\directory_where_lynx_is
C:\...\directory_where_lynx_is\ (Trailing Slash)
C:\...\directory_where_lynx_is\lynx.exe
None seemed to work. Any other ideas?
Re: Running Lynx (text browser) from Batch File?
Posted: 06 Jul 2011 13:37
by aGerman
I downloaded lynx and voilá there is a folder "samples" with lynx.bat inside where you could find at the first sight how to do that. Also did you ever have a look at the "help" folder?
Regards
aGerman
Re: Running Lynx (text browser) from Batch File?
Posted: 06 Jul 2011 14:11
by Wolf_22