View Single Post
  #9   (View Single Post)  
Old 25th March 2009
diw's Avatar
diw diw is offline
Port Guard
 
Join Date: Jul 2008
Posts: 45
Default

Quote:
Originally Posted by drhowarddrfine View Post
It's a sad state of affairs I'd have to pay someone to write code that takes 10 lines or so of bash.
It's not what you know it's who you know (and what they know). :]

How about something much simpler than vbscript. A batch file.
You will need wget - Microsoft of course does not provide such useful utilities.

path.to\wget -O path.to\filename URI
print /d:device path.to\filename

For instance this works for me:
wget -O filename http://www.daemonforums.org/index.php
type filename

I have not used path.to as I am running the batch file from the same directory (folder) as wget. :]
I also don't have a printer so I am using "type" to output to the screen.

/d:device works on local or network printers:
Specifies the name of the print device. Valid values for parallel ports are LPT1, LPT2, and LPT3. Valid values for serial ports are COM1, COM2, COM3, and COM4. You can also specify a network printer by its sharename (\\servername\print_share). The default value is PRN. The values PRN and LPT1 refer to the same parallel port.

Using wget is probably quite easy for you (I am new to it) and also very configurable.

This is a very simple batch file.
If you need anything more (logfiles, filenames based on URI, filenames based on timestamps, etcetera) let me know.
Believe it or not, the CLI in windows does a lot of stuff similar to sh.

Best wishes.
Reply With Quote