Home : Shared Hosting : Sitemap

WHATS INCLUDED:

VB Script & ASP Applications
27th March 2008

Explaining some of the uses for VB script and ASP in the modern development environment. This also explains some uses on server side manipulation and systems maintenance.

The articles index can be located here

(Sat, 04 Sep 2010 21:13:18 GMT)
Craigslist ends adult service ads
Online marketplace Craigslist closes its US adult services listing following pressure from attorneys general and advocacy groups.

(Fri, 03 Sep 2010 10:43:40 GMT)
PS3 hack escapes court challenge
Sony has won a permanent ban in Australia of a hack for its PS3, but the code behind it has been released for free on the web.

(Thu, 02 Sep 2010 15:33:44 GMT)
Memristor revolution backed by HP
A potentially revolutionary circuit component, once a laboratory curiosity, is to be mass-produced for the first time.

(Thu, 02 Sep 2010 12:45:35 GMT)
Global broadband divide revealed
The global disparity in access to broadband around the world and the cost of a connection is revealed by UN figures.

(Thu, 02 Sep 2010 10:15:53 GMT)
Samsung releases iPad competitor
Samsung has become the latest manufacturer to enter into the tablet computer market with its Galaxy Tab.

(Wed, 01 Sep 2010 19:48:35 GMT)
Apple creates a social network
Apple launches a music-based social network called Ping as part of its latest upgrade to the iTunes music software.

(Thu, 02 Sep 2010 09:34:59 GMT)
US seeks input on net data rules
US net users are being asked for their opinions about what ISPs should be allowed to do with web traffic flowing through their networks.

(Thu, 02 Sep 2010 15:49:13 GMT)
Dell pulls out of battle for 3Par
Dell withdraws its bid for 3Par after rival Hewlett-Packard raises its offer for the data storage company to $2.1bn.

(Wed, 01 Sep 2010 16:33:35 GMT)
Sony rolls out rival to iTunes
Sony has unveiled its own music and video download service in an announcement timed to coincide with an Apple media event.

(Wed, 01 Sep 2010 16:04:19 GMT)
Roaming iPhone glitch continues
Mobile operator O2 and Apple are still resolving a months-old data roaming issue, with customers complaining of charges they didn't incur.

(Fri, 03 Sep 2010 09:51:56 GMT)
New gadgets unveiled at IFA fair
Samsung's Galaxy Tab and Toshiba's Folio 100 are amongst the gadgets showcased at the world's largest consumer electronics fair in Berlin.

(Fri, 03 Sep 2010 00:21:00 GMT)
First 'intelligent' stamp on sale
The Royal Mail launches the world's first "intelligent" stamp, the first to work with image recognition technology.

(Wed, 01 Sep 2010 09:21:17 GMT)
Clicking the blue 'e'
Bill Thompson on Microsoft's game-changing browser

(Wed, 18 Aug 2010 07:28:15 GMT)
Paint prose
The source code MacPaint is released but who can read it?

(Fri, 23 Jul 2010 16:30:11 GMT)
Nothing said online is really private
Nothing said online is really private, says Bill Thompson

(Fri, 27 Aug 2010 15:01:30 GMT)
How to work anywhere in the world
How technology allows digital nomads to leave the office behind to work around the world

(Fri, 20 Aug 2010 09:06:25 GMT)
Virtual reality asks tough questions
Virtual reality is allowing scientists to ask difficult questions about human behaviour.

(Fri, 13 Aug 2010 14:25:50 GMT)
Online gaming takes it to the next level
Faster broadband networks could spell the end of the games console, experts say.

(Mon, 23 Aug 2010 07:20:57 GMT)
The rise of the 'mummy bloggers'
Parents blogging about their children have become a global force in marketing.

(Fri, 06 Aug 2010 13:57:08 GMT)
Girl gamers still being left out
The portrayal of women in the game's industry is still lacklustre according to experts and insiders

(Fri, 16 Jul 2010 11:10:45 GMT)
Hi-tech help for disaster zones
How technology has ushered in a new era for aid work in disaster zones

(Thu, 19 Aug 2010 10:27:45 GMT)
Hacker spaces gather pace globally
Community labs are springing up for people who want to hack and test new ideas.

(Thu, 15 Jul 2010 12:15:50 GMT)
View from the end of the world
Photographers and film-makers capture their 3-D views of the corners of virtual worlds

(Fri, 07 May 2010 08:31:14 GMT)
Girl Geeks: Women in tech on top
Are women happy being known as geeks?

(Wed, 25 Aug 2010 08:02:56 GMT)
BBC Micro gets a new lease of life
How the classic PC is helping train a new generation of students in the art of programming.

(Wed, 14 Jul 2010 07:04:30 GMT)
On a mission with the rocket men
In our series about makers and hackers, we look at the world of amateur rocket-makers.

(Thu, 27 May 2010 10:14:43 GMT)
Resurrecting Victorian technology
The release of an album on wax cylinder inspired us to try to make a phonograph to play it.

(Sat, 04 Sep 2010 06:30:13 GMT)
Making music from children's old toys
The Modified Toy Orchestra is a band made up of five musicians - and 48 tweaked toy instruments.

(Fri, 03 Sep 2010 13:19:14 GMT)
What does the future hold for television?
Rory Cellan-Jones tries out 3D video equipment and looks at the latest ultra thin and bright OLED TVs.

(Fri, 03 Sep 2010 10:24:46 GMT)
Data dilema: Privacy or personalisation?
Ian Hardy discovers how top researchers and companies are using today's devices and data to make the world a more interesting place

(Fri, 03 Sep 2010 05:39:35 GMT)
Tablet PCs take on the iPad
Samsung's Galaxy Tab and Toshiba's Folio 100 are among rivals unveiled at the Berlin gadget exhibition.

(Tue, 31 Aug 2010 17:05:56 GMT)
Phone app to monitor heartbeat
More than three million doctors have downloaded a phone application to monitor heartbeats through a phone.

(Fri, 03 Sep 2010 05:43:12 GMT)
Portable video 'is the future'
Toshiba’s UK business manager says its Foilo 100 tablet PC complements trends in media usage.

(Wed, 01 Sep 2010 11:13:18 GMT)
Advertising watchdog moves online
The Advertising Standards Authority (ASA) is extending its remit to cover the online realm.

(Mon, 30 Aug 2010 05:23:27 GMT)
Motion capture clue to human behaviour
The system of digitising actors to create characters in films like Avatar is being used to measure human behaviour in real life.

(Sat, 04 Sep 2010 06:44:23 GMT)
Power play
Turning 16 games consoles into a number-crunching supercomputer

(Fri, 03 Sep 2010 10:21:00 GMT)
Remote control
How the tech savvy help victims cope in a crisis via the web

(Wed, 01 Sep 2010 06:17:09 GMT)
Motion control
The PlayStation Move controller put on test

(Tue, 31 Aug 2010 10:46:58 GMT)
Who are 4chan?
The internet pranksters who helped expose cat bin lady

(Tue, 31 Aug 2010 08:16:28 GMT)
Perfect pitch
Can technology and music happily coexist?

Feed BBC News - Technology

Valid XHTML 1.0 Transitional

Blinklist delicious Digg Facebook furl Google Reddit Stumble Upon Technorati

ASP Tutorials - VB script and ASP Applications

Although many of us are now looking towards .NET technologies there is still worth in Classic ASP and Classic based VB applications. Moving forward in the industry using .NET technologies makes sense but unfortunately it hasn't been around forever and there is still allot of CLassic ASP applications out there and Classic VB applications. The worth of VB script for simple server side manipulation of file structures and Application manipulation are still apparent and in use today.

Over the years in Senior developer positions and Network Operations often working within architecture planning and implementations i have often hit walls that i have managed to overcome using VB script and good old Command line hooks. Working for companies that were modeled around SAAS (Software as a service) the need for hardware and cluster management was apparent. Using VB script to manipulate permissions to lock down possible exploits came in very handy, also using VB script for provisioning of services and automated tasks simplified allot of the hard manual labor, even virus scanning and network packet monitoring using VB had its uses.

Still it all sounds good but it sounds old hat and why would you want to do that?
Well..... still some of the largest suppliers within the UK of e-commerce use the legacy VB script automation written by our systems staff and its proven as easy to maintain and easy to upgrade. Server provisioning is done completely within scheduled VB hooks using CLI shells to automate tasks. Of course we cant mention names but its safe to say that one example is the largest UK based hosted e-commerce provider and before you think it its not Actinic its bigger! Another being logistics management systems and payment gateways.

So give me some examples if its so good i hear you cry....
Ok... lets take a hypothetical situation. Lets say i have 2 servers, i want to mirror the entire file structure by mapping a drive copying the entire contents, oh and lets not forget i don't want to set the permissions manually as its used for a web service, But to be more secure i want to map the drive, copy, then drop the connection. Lets look at an example and then i will explain.

-------------------------------------------------------------------------------------------------------------------------------------------
' Section A
strDriveLetter = "Z:"
strRemotePath = "\\SLAVESERVER\d$"
strUser = "atempadmin"
strPassword = "password"
strProfile = "false"

' Section B
set objShell = wscript.createObject("wscript.shell")
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, _
strProfile, strUser, strPassword
path1 = "D:\"
path2 = "Z:\"

' Section C
set fso = CreateObject("Scripting.FileSystemObject")
set tfile = fso.CreateTextFile(path1 & "\lastdone.txt")
tfile.WriteLine(now())

' Section D
iReturn = objShell.Run("cmd.exe /C xcopy " & path1 & " " & path2 & " /e /Y /F /O /EXCLUDE:D:\web\server side\MyExcludes.txt", 1, TRUE)
iReturn = objShell.Run("cmd.exe /C xcopy " & path2 & " " & path1 & " /e /Y /F /O /EXCLUDE:D:\web\server side\MyExcludes.txt", 1, FALSE)
-------------------------------------------------------------------------------------------------------------------------------------------

Okay so what does it do?
The above script would be run on the server to be mirrored. I have split the script into sections A through D and i will explain each section and what is does. IN this eaxmple xcopy was used as its a stock tools supplied by any version of DOS, its a powerful tool and has the ability to copy ACL information saving the use of other CMD tools such as CACLS. So section A this holds the authentication information required to open a mapped drive using the WScript.Network method.

Section B, well this actually maps the drive using the details in section A. Also it sets up the shell object to run the CLI for the xcopy coming later in the script. When the script executes it will execute using a user that is the member of the system group, this will allow pretty much any CLI command to execute without permission issues. Also i have used this section to define the two paths, in this case the two drive letters.

Section C, I wanted to be able to create a simple 1 line log saying when the last sync occurred so this section basically creates a filesystem object and writes a line with a date/time. I can then recall this later if i wanted with an ASP file etc to pull back the value contained.

Finally Section D, this copies everything, however you will see 2 xcopy commands, this copies everything from the master to the slave, then it copies back incase there's anything new on the slave so that it is held on the master. As the initial copy goes master to slave then anything that has been updated on the slave that should not have been will simply be overwritten. Xcopy is a great command and well worth looking up. There's also an excludes files that tells xcopy to ignore certain files.

So there's one example, when we develop an application its not just about writing a system that does a job. We write systems that you can move from one system to another but also systems that get the most out of the environment. that they are hosted or managed on. Why have a system and a systems administrator. It makes more sense to have a system that manages itself as much as possible. Information on systems development can be found at www.angel-media.net

Username :
Password :