trickery.net  

Go Back   trickery.net > Technical > Programming

Reply
 
Thread Tools
Old 11-Aug-2017, 14:49   #1
The Big Kahuna
Younger than Ethel
The Big Kahuna's Avatar
Join Date: Oct 2003
Location: Chesterfield
Posts: 18,270
The Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond repute
vbs login script error

We have the following in our login script:

Code:
Function Exceptions()	'add proxy exceptions to login script

	
	Set WshShell = WScript.CreateObject("WScript.Shell")
	' Read out current settings for exceptions
	Overrides = WshShell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyOverride")


	strSearchString = ".rmplc.net"	'search for this string to stop replication

	intReturn = InStr( 1, Overrides, strSearchString, 1)
	
	'If intReturn = 0 then 	' if string not found

		' add new and current exceptions 
		WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyOverride",  "blah blah blah ip addresses; <local>" '& Overrides

	'End if

End Function
If the DWORD "ProxyOverride" exists, everything is fine, but if it doesn't, it shits the bed.

Anyone know what I need to change to make it create the value if it doesn't exist?
__________________
If a Les Paul falls out of a tree in the forest, and nobody is there to hear it, does it still sound overpriced?
The Big Kahuna is online now  
 Niq-Scott 
Reply With Quote
Old 11-Aug-2017, 14:54   #2
GroovYF
Octave Doctor
GroovYF's Avatar
Join Date: Oct 2003
Location: Halifax & Leeds
Posts: 23,766
GroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond repute
What value are you getting for intReturn?
Try
Code:
MsgBox intReturn
on a new line after
Code:
intReturn = InStr( 1, Overrides, strSearchString, 1)
Maybe it's not returning "0" but "null"?
__________________
photoblog
GroovYF is offline  
 groovyf 
Reply With Quote
Old 11-Aug-2017, 15:26   #3
[n00b]Zippy
Waterborne Trailer-Trash
[n00b]Zippy's Avatar
Join Date: Oct 2003
Location: Shropshire Union Canal
Posts: 12,826
[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute
Or throwing an error
__________________
And now we rise and we are everywhere
[n00b]Zippy is offline  
Send a message via MSN to [n00b]Zippy
Reply With Quote
Old 11-Aug-2017, 15:28   #4
The Big Kahuna
Younger than Ethel
The Big Kahuna's Avatar
Join Date: Oct 2003
Location: Chesterfield
Posts: 18,270
The Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond repute
That
Attached Images
File Type: jpg error.jpg (35.0 KB, 9 views)
__________________
If a Les Paul falls out of a tree in the forest, and nobody is there to hear it, does it still sound overpriced?
The Big Kahuna is online now  
 Niq-Scott 
Reply With Quote
Old 11-Aug-2017, 15:29   #5
The Big Kahuna
Younger than Ethel
The Big Kahuna's Avatar
Join Date: Oct 2003
Location: Chesterfield
Posts: 18,270
The Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond repute
If I manually create the DWORD and run the script, it performs as it should.
__________________
If a Les Paul falls out of a tree in the forest, and nobody is there to hear it, does it still sound overpriced?
The Big Kahuna is online now  
 Niq-Scott 
Reply With Quote
Old 11-Aug-2017, 15:38   #6
The Big Kahuna
Younger than Ethel
The Big Kahuna's Avatar
Join Date: Oct 2003
Location: Chesterfield
Posts: 18,270
The Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond repute
Quote:
Originally Posted by GroovYF View Post
What value are you getting for intReturn?
Try
Code:
MsgBox intReturn
on a new line after
Code:
intReturn = InStr( 1, Overrides, strSearchString, 1)
Maybe it's not returning "0" but "null"?
Ah, misunderstood (misread actually). I'll try it in a bit.
__________________
If a Les Paul falls out of a tree in the forest, and nobody is there to hear it, does it still sound overpriced?
The Big Kahuna is online now  
 Niq-Scott 
Reply With Quote
Old 11-Aug-2017, 16:15   #7
[n00b]Zippy
Waterborne Trailer-Trash
[n00b]Zippy's Avatar
Join Date: Oct 2003
Location: Shropshire Union Canal
Posts: 12,826
[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute
Registry read is failing, see this

https://stackoverflow.com/questions/...try-key-exists
__________________
And now we rise and we are everywhere
[n00b]Zippy is offline  
Send a message via MSN to [n00b]Zippy
Reply With Quote
Old 11-Aug-2017, 16:25   #8
The Big Kahuna
Younger than Ethel
The Big Kahuna's Avatar
Join Date: Oct 2003
Location: Chesterfield
Posts: 18,270
The Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond repute
Still too much of a noob to know what I need to change.
__________________
If a Les Paul falls out of a tree in the forest, and nobody is there to hear it, does it still sound overpriced?
The Big Kahuna is online now  
 Niq-Scott 
Reply With Quote
Old 11-Aug-2017, 16:30   #9
The Big Kahuna
Younger than Ethel
The Big Kahuna's Avatar
Join Date: Oct 2003
Location: Chesterfield
Posts: 18,270
The Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond repute
Nersh is lurking. At least I'll get called a cunt if nothing else
__________________
If a Les Paul falls out of a tree in the forest, and nobody is there to hear it, does it still sound overpriced?
The Big Kahuna is online now  
 Niq-Scott 
Reply With Quote
Old 11-Aug-2017, 17:20   #10
GroovYF
Octave Doctor
GroovYF's Avatar
Join Date: Oct 2003
Location: Halifax & Leeds
Posts: 23,766
GroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond reputeGroovYF has a reputation beyond repute
I see you're using HKEY_CURRENT_USER in first part, then HKCU in the second part.
Try changing the HKCU to full HKEY_CURRENT_USER

Or, put
Code:
Const HKCU = &H80000001 'HKEY_CURRENT_USER
at the beginning.
__________________
photoblog
GroovYF is offline  
 groovyf 
Reply With Quote
Old 11-Aug-2017, 17:55   #11
The Big Kahuna
Younger than Ethel
The Big Kahuna's Avatar
Join Date: Oct 2003
Location: Chesterfield
Posts: 18,270
The Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond repute
Cheers mate, I'll try it on Monday. I did try changing HKEY_CURRENT_USER to HKCU earlier, but that made no difference.

Basically, this was last edited in 2015, nearly 2 years before I started. The only reason I'm trying to figure it out is because it pisses me off, and nobody else can be arsed.
__________________
If a Les Paul falls out of a tree in the forest, and nobody is there to hear it, does it still sound overpriced?
The Big Kahuna is online now  
 Niq-Scott 
Reply With Quote
Old 12-Aug-2017, 08:44   #12
burundi
WARNING: May contain nuts
burundi's Avatar
Join Date: Oct 2003
Location: Prestonia
Posts: 11,498
burundi has a reputation beyond reputeburundi has a reputation beyond reputeburundi has a reputation beyond reputeburundi has a reputation beyond reputeburundi has a reputation beyond reputeburundi has a reputation beyond reputeburundi has a reputation beyond reputeburundi has a reputation beyond reputeburundi has a reputation beyond reputeburundi has a reputation beyond reputeburundi has a reputation beyond repute
Is there any error handling in the main part of the script

ON ERROR RESUME NEXT or anything similar.

You could add a new error handler which jumps to a new section and creates the DWORD value if the read fails or if you don't need to create the DWORD value just use resume next.

Also you could take this out of the login script and use preferences in an AD GPO instead.
__________________
I arose gigantic and black, I howled at the night and the night howled back.
burundi is offline  
 Geldrey 
Reply With Quote
Old 14-Aug-2017, 09:29   #13
The Big Kahuna
Younger than Ethel
The Big Kahuna's Avatar
Join Date: Oct 2003
Location: Chesterfield
Posts: 18,270
The Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond repute
I just remmed out the following line:

Overrides = WshShell.RegRead("HKEY_CURRENT_USER\Software\Micro soft\Windows\CurrentVersion\Internet Settings\ProxyOverride")

It works now. It's obviously not checking to see if the value already exists, but I can't see it being a problem anyway.

ps. The space in the middle of "Microsoft" is just this shit forum software, not the code.
__________________
If a Les Paul falls out of a tree in the forest, and nobody is there to hear it, does it still sound overpriced?
The Big Kahuna is online now  
 Niq-Scott 
Reply With Quote
Old 14-Aug-2017, 14:53   #14
[RaG]Ethel
Alfa Male
[RaG]Ethel's Avatar
Join Date: Oct 2003
Location: Northumberland
Posts: 13,684
[RaG]Ethel has a reputation beyond repute[RaG]Ethel has a reputation beyond repute[RaG]Ethel has a reputation beyond repute[RaG]Ethel has a reputation beyond repute[RaG]Ethel has a reputation beyond repute[RaG]Ethel has a reputation beyond repute[RaG]Ethel has a reputation beyond repute[RaG]Ethel has a reputation beyond repute[RaG]Ethel has a reputation beyond repute[RaG]Ethel has a reputation beyond repute[RaG]Ethel has a reputation beyond repute
well considering the if statement is remmed out it's going to set the fecker anyway so trying to read the registry is pointless now

if you really want it in there then you can put On Error Resume Next at the top and it'll work.

vbs is hideous though.
__________________
girls girls girls
[RaG]Ethel is offline  
 IaShDa 
Reply With Quote
Old 14-Aug-2017, 15:13   #15
The Big Kahuna
Younger than Ethel
The Big Kahuna's Avatar
Join Date: Oct 2003
Location: Chesterfield
Posts: 18,270
The Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond repute
Yeah, I tried "unremming" the if-then statement, but it made fuck all difference. I checked that it wasn't going to just keep appending the same data over and over, which it doesn't, so I have no fucking idea why they tried checking to see if it already existed in the first place. If it doesn't exist, it fucks up. If it already exists (the Key) it works, and adds the values.

2 fucking years they've been putting up with this shit. Some people even have the script on their desktop, which they run every morning manually.
__________________
If a Les Paul falls out of a tree in the forest, and nobody is there to hear it, does it still sound overpriced?
The Big Kahuna is online now  
 Niq-Scott 
Reply With Quote
Old 14-Aug-2017, 15:14   #16
The Big Kahuna
Younger than Ethel
The Big Kahuna's Avatar
Join Date: Oct 2003
Location: Chesterfield
Posts: 18,270
The Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond repute
Quote:
Originally Posted by [RaG]Ethel View Post
vbs is hideous though.
Nobody uses Cobol any more, so my choices are limited.
__________________
If a Les Paul falls out of a tree in the forest, and nobody is there to hear it, does it still sound overpriced?
The Big Kahuna is online now  
 Niq-Scott 
Reply With Quote
Old 14-Aug-2017, 16:24   #17
[n00b]Zippy
Waterborne Trailer-Trash
[n00b]Zippy's Avatar
Join Date: Oct 2003
Location: Shropshire Union Canal
Posts: 12,826
[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute[n00b]Zippy has a reputation beyond repute
Loads of people do, great skill if you've got it and you want to coast gently into retirement supporting legacy apps!
__________________
And now we rise and we are everywhere
[n00b]Zippy is offline  
Send a message via MSN to [n00b]Zippy
Reply With Quote
Old 15-Aug-2017, 08:31   #18
The Big Kahuna
Younger than Ethel
The Big Kahuna's Avatar
Join Date: Oct 2003
Location: Chesterfield
Posts: 18,270
The Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond reputeThe Big Kahuna has a reputation beyond repute
To be honest, the word "skill" was rarely used in relation to my Cobol abilities
__________________
If a Les Paul falls out of a tree in the forest, and nobody is there to hear it, does it still sound overpriced?
The Big Kahuna is online now  
 Niq-Scott 
Reply With Quote
Reply

Go Back   trickery.net > Technical > Programming


Similar Threads
Thread Thread Starter Forum Replies Last Post
The fun you can have with blograffiti blurr Discussion 43 24-Aug-2006 11:26
Citrix Metaframe + Login scripts GroovYF Software & Security 4 19-Jul-2006 14:12
W2K login problem... jimbobaggies Software & Security 15 13-Jul-2006 00:04
Error trying to start Titan Quest. popej Software & Security 1 30-Jun-2006 15:47
Help test my files upload script Jamey Half-Life: Counter-Strike 8 12-Jan-2004 19:28

Users Viewing Thread: 1 (0 members and 1 guests)
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:12.


Powered by vBulletin® Version 3.7.0 Release Candidate 3
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2003 - 2013, trickery.net