Welcome, Register for free! or Login below:
EduGeek.net RSS Feeds Register FAQ Members Social Groups User Map Calendar Search Today's Posts Mark Forums Read

Windows Vista

Windows Vista forum sponsored by
Vista Forum Sponsored by The Net Exchange

It's here, it's awkward and you will have to use it eventually, so let us make the mistakes so you don't have to.

Go Back   EduGeek.net Forums > Technical > Windows Vista
Reply
 
LinkBack Thread Tools Search Thread
Sponsored Links
Old 09-09-2008, 08:24 AM   #1
 
kiran's Avatar
 
Join Date: Apr 2006
Location: West Midlands
Posts: 272
uk
Thanks: 14
Thanked 12 Times in 11 Posts
Rep Power: 9 kiran will become famous soon enough
Default Accesss Denied Error VBS Login Script

Ok... A on a few occasions now when I logon to my vista machine I get an Access Denied error on VBS Script which is only mapping network drives and printers [800A0046] - of which the code is pasted below.

I have full admin and domain rights and this only occurs on Vista - on XP it's not a problem.

I use Roaming Profiles and deleting it and starting fresh seems to solve the problem a bit and then it reoccurs after a while.


The error occurs on the second from last line.

Code:
'CONSTRUCTORS
'----------------------------------------------
Option Explicit

Dim objNetwork, objSysInfo, strUserDN
Dim objGroupList, objUser, objFSO
Dim strComputerDN, objComputer
Dim WshNetwork
Dim UserName
Dim ComputerName


set Wshnetwork = CreateObject("WScript.Network")

Set objNetwork = CreateObject("Wscript.Network")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objSysInfo = CreateObject("ADSystemInfo")


strUserDN = objSysInfo.userName


'ERROR HERE LINE 44 BELOW!!>>>>>>>>>>>>>>>>>>
strComputerDN = objSysInfo.computerName

Set WshNetwork = WScript.CreateObject("WScript.Network")
etc...

Any help greatly appreciated! Thanks
  Reply With Quote
Old 09-09-2008, 09:08 AM   #2
 
altecsole's Avatar
 
Join Date: Jun 2005
Location: Lancaster, Lancashire, UK.
Posts: 223
uk
Thanks: 13
Thanked 20 Times in 16 Posts
Rep Power: 12 altecsole will become famous soon enoughaltecsole will become famous soon enough
Default

What about:

Set WshNetwork = WScript.CreateObject("WScript.Network")
strComputer = WshNetwork.ComputerName
strUser = WshNetwork.UserName
  Reply With Quote
Old 09-09-2008, 09:10 PM   #3
 
kiran's Avatar
 
Join Date: Apr 2006
Location: West Midlands
Posts: 272
uk
Thanks: 14
Thanked 12 Times in 11 Posts
Rep Power: 9 kiran will become famous soon enough
Default

Quote:
Originally Posted by altecsole View Post
What about:

Set WshNetwork = WScript.CreateObject("WScript.Network")
strComputer = WshNetwork.ComputerName
strUser = WshNetwork.UserName
Would these replace the main bulk of code...?
  Reply With Quote
Old 10-09-2008, 02:14 PM   #4
 
altecsole's Avatar
 
Join Date: Jun 2005
Location: Lancaster, Lancashire, UK.
Posts: 223
uk
Thanks: 13
Thanked 20 Times in 16 Posts
Rep Power: 12 altecsole will become famous soon enoughaltecsole will become famous soon enough
Default

Quote:
Originally Posted by kiran View Post
Would these replace the main bulk of code...?
Do you want the distinguished name for the computer and user, or just the short name?

The code you posted retrieves the dn and works fine for me. What error message do you get?
  Reply With Quote
Old 11-09-2008, 09:38 PM   #5
 
ajbritton's Avatar
 
Join Date: Jul 2005
Location: Wandsworth
Posts: 1,429
uk
Thanks: 9
Thanked 16 Times in 11 Posts
Rep Power: 12 ajbritton will become famous soon enough
Default

Googled for AdSystemInfo and Vista...

ADSystemInfo causes logon script to hang in Vista
  Reply With Quote
Reply
Similar Threads
Thread Thread Starter Forum Replies Last Post
Photostory Access denied error. ICT_GUY Windows 18 05-05-2009 10:46 AM
vbs overflow error strawberry Scripts 5 04-09-2008 10:31 AM
Sub within a sub - VBS Script FN-GM Scripts 5 18-05-2008 06:30 PM
VBS Script to copy a folder FN-GM Scripts 2 23-02-2008 01:08 PM
Trace a VBS Script chalkwellstu Scripts 3 25-01-2008 11:34 AM



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search Thread
Search Thread:

Advanced Search

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:26 AM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright EduGeek.net




website uptime

© 2005 - 2009 EduGeek.net
no new posts