Useful Scripts vbscript


I ran into a problem recently with my windows batch script files because I use this great utility called URL2FILE.exe which is a free 32bit Windows console-mode application able to retrieve and save the content of a World Wide Web content to a local file. Well, for some unknown reason our company virus scan software, VirusScan, decided that URL2FILE.exe was a Generic PUP.z virus and cascade deleted all copies of the file on our server! In an instant all my services that use the file was rendered useless!

Virus Console

With limited knowledge of Windows Script Hosting and VbScript, I’ve managed to write up a small vbscript file that pretty much does what url2file aims to do with text files (please note that the script does NOT work with binary files). To effectively create a script that replicates the download of web pages similar to what url2file.exe does, then do the following:

Download and install Windows script hosting from:

Save the following code as URL2FILE.vbs:

'Wscript.Arguments(0) - Website  URL
'Wscript.Arguments(1) - Full File Path
Dim lngResolveTimeout, lngConnectTimeout, lngSendTimeout, lngReceiveTimeout, retVal
'30 Min timeout when accessing web page
lngResolveTimeout = 1800000
lngConnectTimeout = 1800000
lngSendTimeout = 1800000
lngReceiveTimeout = 1800000
'Valid URL continue validation
Dim xml, txresponse
Set xml = CreateObject("MSXML2.ServerXMLHTTP")
xml.setTimeouts lngResolveTimeout, lngConnectTimeout, lngSendTimeout, lngReceiveTimeout
xml.Open "GET", Wscript.Arguments(0), False
'Write response to file
Dim oFs, oTextFile, iMode
iMode = 2
set oFs = createobject("Scripting.FileSystemObject")
set oTextFile = oFs.OpenTextFile(Wscript.Arguments(1), iMode, True)
oTextFile.Write xml.responseText
set oTextFile = nothing
set oFS = nothing

To run the script in a command prompt session:

url2file.vbs [URL] [FULL OUTPUT FILE PATH]
eg. url2file.vbs http://localhost/test.htm c:\temp\test.htm

website marketing

Web Backlinks

Web Backlinks is a directory on the World Wide Web which focuses on websites written in English (or has support for English). Web Backlinks specializes in linking to other web sites and categorizing those links, which effectively lists web sites by category and subcategory. Listed sites are limited to inclusion in only two categories (Category and Sub-category).

We support the following listings:

  1. Regular Link – subject to expiry (FREE website submission)
  2. Reciprocal Link – a link back to Web Backlinks directory must be added somewhere on the submitted site in order to get listed in the directory and is subject to expiry (FREE submission)
  3. Paid Submissions (Reciprocal and Regular) – a one-time fee is charged for listing the submitted link and is NOT subject to expiry

All page URLs in our directory are SEO friendly and are 100% XHTML 1.0 Strict compliant making our directory extremely “crawlable” by web spiders.


Remove Header and Footer When Printing a Web Page in IE7

A lot of developers attempt to “programmatically” control suppressing the print of header and footer when printing a web page. You are able to configure a lot of things when sending a print request to the computer system but suppressing or changing the header and footer values are not one of them.

Unfortunately, the header and footer values are printed by default by the operating system’s printing subsystem. It cannot be controlled using CSS or any scripting language.

You are able to override the values in IE7 by doing the following:

  1. On your IE window, Select ‘File’ -> ‘Print Preview’
  2. Click on the Page Setup Icon (Cog)
  3. Under the ‘Headers and Footers’ section, clear or overwrite the ‘Header’ and/or ‘Footer’ values.

Print Preview

Fortunately, the settings will remain until the next time you change it.

XBOX 360

XBOX 360 Video Card Problem

3rolAs I made my first and final attempt to ressurect my very ill XBOX 360, I began to think about what the console really meant to me. I played a lot of XBOX 360 games. I’ve come to realise now that they’re all very much a like. First person shoot up, third person shoot up, they all got the same jagged feel. The stiff like animation of people are all eerily familiar, no matter what the title is… the same limited hand motion that doesn’t have finger “joints”. Frankly, the gaming company need to update their games’ APIs.

As I sift through the internet trying to find a fix for my partially fried XBOX 360 video card, I figured that this was the last straw. People pay good money for a gaming console that they think is going to entertain them for a long time. Unfortunately for most, their console starts to show signs of weekness only months after they buy the damn thing.

I consider myself lucky because my XBOX 360 died over two years after I paid for it. That must be a record! I got the usual 3ROL (3 rings of Light or death or whatever it’s called these days) I took my console to my retailer… lucky for me I paid a few extra bucks to extend my warranty period to 3 years. Anyway, I drove to Harvey Norman (the retailer I bought my 360 from) with my console and spoke to a technician, who mentioned that Microsoft handles their own warranty so I needed to contact them directly. I thought that was odd because I paid extra $$$ so that Harvey Norman would handle warranty related issues with my console.

I contacted Microsoft and they mentioned that I was not covered (standard warranty is 1 year), and that extended warranty should be handled by the retailer who sold me the unit. Well, after a lot of arguments with a Harvey Norman representative, HN finally took my console in to get it repaired.

8 weeks later still no XBOX 360. I’m a patient man but 8 weeks and no phone call from HN!?! I finally got sick of waiting so I contacted Harvey Norman and quizzed them on how my 360 repair was going. Technician advised that my 360 is still sitting in the repair bench which is where it was when I dropped it off 8 weeks ago. I was furious at that point (I guess any normal human would be) so I told HN that I was driving to the store on that same day and demanded that a new console be ready for me when I get there! Well I got to the store and I got a new console.

This new console is average. Well, I got reason to believe that the XBOX 360 is manufactured to only function a few days after its warranty expires. Want proof? Google it. Thousands of unhappy customers suffering from the same old 3ROL… Thousands of websites with the same consistent methods of fixing the problem. Microsoft even admitted at one point that the console was defective, by extending the standard warranty from 1 to 3 years last year!

Only a couple of problems… My warranty expired and my XBOX 360 is broken. No 3 rings of light. In fact I can still play games, but the video is all crap, shadowy (like a really crappy SGA monitor) after the console has been on for while, then just green and purple lines. I can’t play hi-def games like this, might as well get my Amstrad CPC464 out of the attic!

I opened the thing up and tried to do the x-clamp fix (even though no 3ROL, but I knew the thing was going to go anyway). No good. Time to say good bye. I guess I’m just one of the first few people who experienced the new strain of problem with the XBOX 360…. fried video card… I found about two or three other posts about this problem.

The only thing I will miss about the XBOX 360 is playing NBA 2K8! I used to be an NBA LIVE fan until I bought and played NBA LIVE 2007, which was absolute rubbish. I started looking for an alternative title and found 2K7 (My wife bought it for me! What a woman!). It was OK at first (I couldn’t control my team properly.. kept pressing the wrong button! I had to unlearn LIVE controls, then learn 2K controls), but after I mastered the controls, it became fantastic! 2K8 was even better! I got to say, 2K make the best sports games! I played their tennis and table tennis games and they were both great!

I’ve given up on the 360. How about the PS3, is it any good?