Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Scripting Newbie Question

$
0
0

Hi everyone,
I am a complete VBS scripting newbie, I am trying to get my head around what different parts of a script are actually doing & why. As I am hoping this will help me to understand what I am actually trying to achieve.  I have attached a script and am hoping someone might give a simple summary of what the script is doing in astep by step manner.

Thx in advance Pete.

1 ...... Dim oSystemInfo
2 ...... Dim oShell, oNetwork
3 ...... Dim sLogonServer, sSiteName
4 ...... Set oShell = Wscript.CreateObject(“Wscript.Shell”)
5 ...... sLogonServer = oShell.ExpandEnvironmentStrings(“%LOGONSERVER%”)
6 ...... Set oSystemInfo = CreateObject(“ADSystemInfo”)
7 ...... sSiteName = oSystemInfo.SiteName
8 ...... On Error Resume Next
9 ...... Set oNetwork = CreateObject("WScript.Network" )
10 ...... Select Case sSiteName
11 ......      Case “Brisbane”
12 ......             oNetwork.RemovePrinterConnection\\BRS01\Laser1
13 ......       Case “Darwin”
14 ......             oNetwork.RemovePrinterConnection\\DAC02\LaserJet
15 ......       Case “Hobart”
16 ......              oNetwork.RemovePrinterConnection\\HOSrv\HP2
17 ......       Case “Melbourne”18......oNetwork.RemovePrinterConnection\\MEG4\LaserJet
19 ......       Case “Sydney”
20 ......              oNetwork.RemovePrinterConnection\\SY2\HP03
21 ...... End Select
22 ......              oNetwork.RemoveNetworkDrive “L:”, True


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>