Solved

Logon script VB XP vs Win7

Posted on 2010-08-23
7
470 Views
Last Modified: 2012-05-10
When I run my login script on XP everithing works fine
When I run my login script on Win7 it hangs when it comes to connect the printers.
Both are same scripts
In the script this is the last line who Win7 executes:MSIE.Document.Write "<BR></B>Tengi prentara - Ritari-litur"

and hang forever.
'**** Logon script  **** 





On Error Resume Next





sTITLE = "Grunnskóli Grundarfjarðar"



Dim Network

Set Network = CreateObject("WScript.Network")  

Set MSIE = CreateObject("InternetExplorer.Application")



Drive = "U:"

Share = "\\pottur.gg.ic\" & Network.UserName & "$"



SetupMSIE



MSIE.Document.Write "<HTML><TITLE>" & sTITLE & _

  "</TITLE><BODY bgcolor=#FFFFFF><FONT FACE=Thaoma><CENTER>Halló</CENTER><BR><BR>"

MSIE.Document.Write "<BR><B>Tengist nú skráarsvæði.. </B><BR><BR> "





'**** Welcome script for users ****





If Hour(Now) < 12 Then

  MSIE.Document.Write "</B>Góðan daginn " & _

  Network.Username & "</B><BR><BR>"

ElseIf Hour(Now) < 18 Then

  MSIE.Document.Write "</B>Góðan daginn " & _

  Network.Username & "</B><BR><BR>"

Else

  MSIE.Document.Write "Gott kvöld " & _

  Network.Username & "</B><BR><BR>"

End If



Wscript.Sleep 500





'******************** Checking Connection to Home drive ***********************





MSIE.Document.Write "</B>Tengi " & Drive & " við " & _

  Share & " ...</B><BR><BR>"

Network.MapNetworkDrive Drive, Share

Wscript.Sleep 1000

If Err.Number = 0 Then	

  MSIE.Document.Write "Tenging heppnaðist</B><BR> "

Else  	  

  MSIE.Document.Write "<B>Tenging mistókst, eða þegar til staðar<B> " & Drive & " við " & _

    Share & "</B><BR>"

End If



Wscript.Sleep 500



 

'************** Connecting network drives ***************************







MSIE.Document.Write "<BR></B>Tengi sameiginlegu drifin...."

Wscript.Sleep 500



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



MSIE.Document.Write "<BR></B>Tengi Almenning...."

WshNetwork.MapNetworkDrive "N:", "\\pottur.gg.ic\Almenningur"

MSIE.Document.Write "<BR></B>Tengi Skrifstofu...."

WshNetwork.MapNetworkDrive "K:", "\\pottur.gg.ic\Skrifstofa$"

MSIE.Document.Write "<BR></B>Tengi Skila...."

WshNetwork.MapNetworkDrive "V:", "\\pottur.gg.ic\skila"

MSIE.Document.Write "<BR></B>Tengi ...."

MSIE.Document.Write "<BR></B>Tengi Sérkennsluþjón...."

WshNetwork.MapNetworkDrive "J:", "\\pottur.gg.ic\serkennslutjonn"

'WshNetwork.MapNetworkDrive "W:", "\\pottur.gg.ic\vefur-skoli$" 

MSIE.Document.Write "<BR></B>Tengi síðasta drifið...."

WshNetwork.MapNetworkDrive "X:", "\\big-220.gg.ic\BIG" 







'******************* Printer installation *************************************





'MSIE.Document.Write "<BR></B>Tengi prentara - Uppi-litur"

'PrinterPath1 = "\\pottur.gg.ic\Uppi-litur"

'WshNetwork.AddWindowsPrinterConnection PrinterPath1



MSIE.Document.Write "<BR></B>Tengi prentara - Ritari-svartur"

PrinterPath2 = "\\pottur.gg.ic\Ritari-svartur"

WshNetwork.AddWindowsPrinterConnection PrinterPath2



MSIE.Document.Write "<BR></B>Tengi prentara - Ritari-litur"

THIS LINE IS THE LAST LINE WINDOWS7 CAN SEE

PrinterPath3 = "\\pottur.gg.ic\Ritari-litur"

WshNetwork.AddWindowsPrinterConnection PrinterPath3



MSIE.Document.Write "<BR></B>Tengi prentara - Tölvuver-litur"

PrinterPath4 = "\\pottur.gg.ic\Tolvuver-litur"

WshNetwork.AddWindowsPrinterConnection PrinterPath4



'PrinterPath5 = "\\pottur.gg.ic\HP3525"

'WshNetwork.AddWindowsPrinterConnection PrinterPath5

MSIE.Document.Write "<BR></B>Set Default prentara... "

WshNetwork.SetDefaultPrinter("\\pottur.gg.ic\Ritari-svartur")





'******************* Texti sem byrtist í Internet Explorer **********************





'Wscript.Sleep 500

'MSIE.Document.Write "<BR><BR></B>Upgrading Trend virusprotection ......"

'WshShell.Run "\\trend\ofcscan\autopcc.exe"

MSIE.Quit





'******************** Undirforrit sem setur upp Internet Explorer. **************





Sub SetupMSIE

  MSIE.Navigate"http://mbl.is"

  MSIE.ToolBar = False

  MSIE.StatusBar = False

  MSIE.Resizable = False

  

  Do

  Loop While MSIE.Busy

    

  SWidth = MSIE.Document.ParentWindow.Screen.AvailWidth

  SHeight = MSIE.Document.ParentWindow.Screen.AvailHeight

  MSIE.Width = SWidth/2

  MSIE.Height = SHeight/2

  MSIE.Left = (SWidth - MSIE.Width)/2

  MSIE.Top = (SHeight - MSIE.Height)/2

  

  MSIE.Visible = True

End Sub

Open in new window

0
Comment
Question by:soffcec
  • 4
  • 3
7 Comments
 
LVL 31

Assisted Solution

by:Justin Owens
Justin Owens earned 500 total points
ID: 33504119
Does it actually add PrinterPath2 (as on like 90) before it hangs on line 92?
0
 

Author Comment

by:soffcec
ID: 33504807
Sorry, this is wrong line. I meant Windows write out line 88 and then stops
0
 
LVL 31

Assisted Solution

by:Justin Owens
Justin Owens earned 500 total points
ID: 33504977
That makes more sense.  Windows 7 has a different permission set related to printers.  Make sure you have the following settings:

Disallow installation of printers using kernel-mode drivers - Disabled  
 Only use Package Point and print - Disabled  
 Package Point and print - Approved servers  - Disabled  
 Point and Print Restrictions - Disabled

For more information on Printer Security settings check out this article:

http://technet.microsoft.com/en-us/library/cc753269.aspx

Justin



0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:soffcec
ID: 33516236
Where can I change these settings ??

Disallow installation of printers using kernel-mode drivers - Disabled  
Only use Package Point and print - Disabled  
Package Point and print - Approved servers  - Disabled  
Point and Print Restrictions - Disabled
0
 
LVL 31

Assisted Solution

by:Justin Owens
Justin Owens earned 500 total points
ID: 33521217
Group Policy: Computer Configuration -> Policies -> Administrative Templates -> Printers : Point and Print Restrictions

Source: http://support.microsoft.com/kb/2307161

Justin
0
 

Author Comment

by:soffcec
ID: 33521462
I am using ADS on server 2003 and missing most of these settings. I only have Disallow installation of printers using kernel-mode drivers
0
 
LVL 31

Accepted Solution

by:
Justin Owens earned 500 total points
ID: 33533061
You need to extend your Schema to include the Vista and Windows 7 and Server 2008 ADM templates.

http://msdn.microsoft.com/en-us/library/ms676929%28v=VS.85%29.aspx

http://technet.microsoft.com/en-us/library/cc753437%28WS.10%29.aspx

http://www.petri.co.il/understanding-windows-server-2008-active-directory-domain-and-forest-functional-levels.htm

Remember, though, if you extend your Schema, you can't go back.  The third link shows the advantages of a 2008 functional level domain.

Justin
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
OfficeMate Freezes on login or does not load after login credentials are input.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now