[THIN] Re: VBscript help needed

  • From: "Andrew Wood" <andrew.wood@xxxxxxxxxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Fri, 3 Jul 2009 12:08:25 +0100

For the DIM - that shouldn't matter - you'd only really need it if you'd put
explicit references in - which Steve hasn't

 

That code looked fine to me - and it works on my 2003 server when I cut and
pasted it into a .vbs script 

 

There's not some funny text/typo in the script you're running?

 

From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On Behalf
Of Joe Shonk
Sent: 03 July 2009 06:06
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: VBscript help needed

 

Try removing "Dim objShell" from the script and try again.

 

Joe

 

From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On Behalf
Of Steve Snyder
Sent: Thursday, July 02, 2009 9:14 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] VBscript help needed

 

Wrote (okay, plagarized and cobbled) a script to perform an action based on
the user being in a group; runs great on my XP PC, but on a W2K3 server
itbombs out on the line

 

Set objShell = WScript.CreateObject("WScript.Shell")


with an Invalid Syntax error. Ideas?

 

 

 

'begin here

GroupName="no_internet-gp"
 
Set objSysInfo = CreateObject("ADSystemInfo")
strUserInfo = "LDAP://" & objSysInfo.UserName

Set objUser = GetObject(strUserInfo) 
arrMember=Filter(objUser.MemberOf ,GroupName)

Dim objShell, RegLocate, RegLocate1
Set objShell = WScript.CreateObject("WScript.Shell")
 
On Error Resume Next


If ubound(arrMember) Then wscript.Quit
If Err.Number <> 0 Then 
  WScript.echo Err.Description 
Else
  RegLocate =
"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet
Settings\ProxyEnable"
  objShell.RegWrite RegLocate,"1","REG_DWORD"

  RegLocate =
"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet
Settings\ProxyServer"
  objShell.RegWrite RegLocate,"127.0.0.1:80","REG_SZ"

  RegLocate =
"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet
Settings\ProxyOverride"
  objShell.RegWrite
RegLocate,"etimesheets.*;smdc*;164.49.*;<local>","REG_SZ"

End If

'end here

Other related posts: