Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login Script Causes Reboot w/ XP SP2

Status
Not open for further replies.

smartin35

IS-IT--Management
Nov 13, 2001
29
US
I am using a simple VB script that maps a few common drives and several additioanl drives based on group membership. Inside the script I am also mapping an H: drive for the users home directory. We have received several new machines recently with SP2 already installed. When these machines run the login script they reboot. If I comment out the homeshare directory line they come up fine. Alternatively, if I change the homeshare mapping in the users account profile to a letter other than the one that I refer to in my script, it works fine. It seems as though XP SP2 does not like it when a drive is double mapped. I also tried deleting the mapping in the script before mapping it a second time and that did not work. Any one else having this issue? Suggestions and comments welcome.

Thanks
 
1. It seems as though XP SP2 does not like it when a drive is double mapped
How do you mean double-mapped?
2. It might be helpful to see the script
 
Does it say anything about the reboots in Event Viewer?
 
By double mapping I mean this:

In the user's account profile there is an entry for mapping the home folder. Ex: H: \\japan\is

In the login script there is a statement to map H: to the homeshare (which should be pulled from the account profile)

Here's the script:

'**********************************************************************************
' Set Environment Variables
'*********************************************************************************
Set WSHNetwork = WScript.CreateObject("WScript.Network")
Set WSHShell = WScript.CreateObject("WScript.Shell")

On Error Resume Next

Domain = WSHNetwork.UserDomain
UserName = ""

While UserName = ""
UserName = WSHNetwork.UserName
MyGroups = GetGroups(Domain, UserName)
Wend

'*********************************************************************************
' Main Process:
'*********************************************************************************
GrpMeb UserName
ShowBox

Wscript.Quit

'*********************************************************************************
'Function: GetGroups
'*********************************************************************************
Function GetGroups(Domain, UserName)
Set objUser = GetObject("WinNT://" & Domain & "/" & UserName)
GetGroups=""
For Each objGroup In objUser.Groups
GetGroups=GetGroups & "[" & UCase(objGroup.Name) & "]"
Next
End Function

'********************************************************************************
'Function: InGroup
'********************************************************************************
Function InGroup(strGroup)
InGroup=False
If InStr(MyGroups,"[" & UCase(strGroup) & "]") Then
InGroup=True
End If
End Function

'*********************************************************************************
' MapDrives Subroutine
'*********************************************************************************
Sub MapDrive(sDrive,sShare)
On Error Resume Next
WSHNetwork.RemoveNetworkDrive sDrive
Err.Clear
WSHNetwork.MapNetworkDrive sDrive,sShare
End Sub

'********************************************************************************
'Map Drives:
'********************************************************************************
Sub GrpMeb(UNAME)
MapDrive "P:", "\\coral\dbfiles"
MapDrive "I:", "\\coral\dbase"
MapDrive "N:", "\\japan\public"
If INGROUP ("finance") Then
MapDrive "R:", "\\scotia\finance"
End If
If INGROUP ("abms") Then
MapDrive "Z:", "\\prresource\abms"
End If
If INGROUP ("information systems") Then
MapDrive "R:", "\\japan\cde$"
End If
If INGROUP ("information systems") Then
MapDrive "X:", "\\scotia\trackit"
End If
If INGROUP ("application testers") Then
MapDrive "L:", "\\scotia\dev"
End If
If INGROUP ("imax") Then
MapDrive "S:", "\\black\imax"
End If
If INGROUP ("entrendex") Then
MapDrive "T:", "\\seto\entrendex"
End If
If INGROUP ("human resources") Then
MapDrive "R:", "\\scotia\cobra"
End If
If INGROUP ("shared_folders") Then
MapDrive "R:", "\\mbs2\mbs"
End If
Return = WSHShell.Run("\\scotia\ofcscan\autopcc.exe", 5, true)
On Error Resume Next
WSHNetwork.RemoveNetworkDrive "H:"
Err.Clear
strCmd = "net.exe use H: /home >null"
WshShell.Run strCmd, 0
strCmd = "net.exe time \\aral /set /yes >null"
WshShell.Run strCmd, 0
End Sub
'
'********************************************************************************
'Display Dialog:
'********************************************************************************
Sub ShowBox
strMsgtxt = "You are mapped to the following drive letters:" & vbNewLine
strMsgtxt = strMsgtxt & "P: = \\coral\dbfiles" & vbNewLine
strMsgtxt = strMsgtxt & "I: = \\coral\dbase" & vbNewLine
strMsgtxt = strMsgtxt & "N: = \\japan\public" & vbNewLine
strMsgtxt = strMsgtxt & "R: = \\scotia\finance" & vbNewLine
strMsgtxt = strMsgtxt & "Z: = \\prresource\abms" & vbNewLine
strMsgtxt = strMsgtxt & "R: = \\japan\cde$" & vbNewLine
strMsgtxt = strMsgtxt & "X: = \\scotia\trackit" & vbNewLine
strMsgtxt = strMsgtxt & "L: = \\scotia\dev" & vbNewLine
strMsgtxt = strMsgtxt & "S: = \\black\imax" & vbNewLine
strMsgtxt = strMsgtxt & "T: = \\seto\entrendex" & vbNewLine
strMsgtxt = strMsgtxt & "R: = \\scotia\cobra" & vbNewLine
strMsgtxt = strMsgtxt & "R: = \\mbs2\mbs" & vbNewLine
strMsgtxt = strMsgtxt & "You are mapped to the following printers:" & vbNewLine
strMsgtxt = strMsgtxt & "H: = Home Drive" & vbNewLine
msgbox = WshShell.Popup(strMsgtxt, 2, "Logon Script", 0)
End Sub


I should clarify that when I say reboots....it is actually blue screening...that is if I turn off auto reboot. The error messages are consistent with a stop error 00000025. There is no additional information in the event log. I have looked at articles dealing with the stop error but they do not apply to this particular situation.

Thanks
 
Do you have installed either:
Trend Micro Office Scan, or,
PC-Illan antivirus?

Update or remove.
 
By double mapping I mean this:

In the user's account profile there is an entry for mapping the home folder. Ex: H: \\japan\is

In the login script there is a statement to map H: to the homeshare (which should be pulled from the account profile)

Here's the script:

'**********************************************************************************
' Set Environment Variables
'*********************************************************************************
Set WSHNetwork = WScript.CreateObject("WScript.Network")
Set WSHShell = WScript.CreateObject("WScript.Shell")

On Error Resume Next

Domain = WSHNetwork.UserDomain
UserName = ""

While UserName = ""
UserName = WSHNetwork.UserName
MyGroups = GetGroups(Domain, UserName)
Wend

'*********************************************************************************
' Main Process:
'*********************************************************************************
GrpMeb UserName
ShowBox

Wscript.Quit

'*********************************************************************************
'Function: GetGroups
'*********************************************************************************
Function GetGroups(Domain, UserName)
Set objUser = GetObject("WinNT://" & Domain & "/" & UserName)
GetGroups=""
For Each objGroup In objUser.Groups
GetGroups=GetGroups & "[" & UCase(objGroup.Name) & "]"
Next
End Function

'********************************************************************************
'Function: InGroup
'********************************************************************************
Function InGroup(strGroup)
InGroup=False
If InStr(MyGroups,"[" & UCase(strGroup) & "]") Then
InGroup=True
End If
End Function

'*********************************************************************************
' MapDrives Subroutine
'*********************************************************************************
Sub MapDrive(sDrive,sShare)
On Error Resume Next
WSHNetwork.RemoveNetworkDrive sDrive
Err.Clear
WSHNetwork.MapNetworkDrive sDrive,sShare
End Sub

'********************************************************************************
'Map Drives:
'********************************************************************************
Sub GrpMeb(UNAME)
MapDrive "P:", "\\coral\dbfiles"
MapDrive "I:", "\\coral\dbase"
MapDrive "N:", "\\japan\public"
If INGROUP ("finance") Then
MapDrive "R:", "\\scotia\finance"
End If
If INGROUP ("abms") Then
MapDrive "Z:", "\\prresource\abms"
End If
If INGROUP ("information systems") Then
MapDrive "R:", "\\japan\cde$"
End If
If INGROUP ("information systems") Then
MapDrive "X:", "\\scotia\trackit"
End If
If INGROUP ("application testers") Then
MapDrive "L:", "\\scotia\dev"
End If
If INGROUP ("imax") Then
MapDrive "S:", "\\black\imax"
End If
If INGROUP ("entrendex") Then
MapDrive "T:", "\\seto\entrendex"
End If
If INGROUP ("human resources") Then
MapDrive "R:", "\\scotia\cobra"
End If
If INGROUP ("shared_folders") Then
MapDrive "R:", "\\mbs2\mbs"
End If
Return = WSHShell.Run("\\scotia\ofcscan\autopcc.exe", 5, true)
On Error Resume Next
WSHNetwork.RemoveNetworkDrive "H:"
Err.Clear
strCmd = "net.exe use H: /home >null"
WshShell.Run strCmd, 0
strCmd = "net.exe time \\aral /set /yes >null"
WshShell.Run strCmd, 0
End Sub
'
'********************************************************************************
'Display Dialog:
'********************************************************************************
Sub ShowBox
strMsgtxt = "You are mapped to the following drive letters:" & vbNewLine
strMsgtxt = strMsgtxt & "P: = \\coral\dbfiles" & vbNewLine
strMsgtxt = strMsgtxt & "I: = \\coral\dbase" & vbNewLine
strMsgtxt = strMsgtxt & "N: = \\japan\public" & vbNewLine
strMsgtxt = strMsgtxt & "R: = \\scotia\finance" & vbNewLine
strMsgtxt = strMsgtxt & "Z: = \\prresource\abms" & vbNewLine
strMsgtxt = strMsgtxt & "R: = \\japan\cde$" & vbNewLine
strMsgtxt = strMsgtxt & "X: = \\scotia\trackit" & vbNewLine
strMsgtxt = strMsgtxt & "L: = \\scotia\dev" & vbNewLine
strMsgtxt = strMsgtxt & "S: = \\black\imax" & vbNewLine
strMsgtxt = strMsgtxt & "T: = \\seto\entrendex" & vbNewLine
strMsgtxt = strMsgtxt & "R: = \\scotia\cobra" & vbNewLine
strMsgtxt = strMsgtxt & "R: = \\mbs2\mbs" & vbNewLine
strMsgtxt = strMsgtxt & "You are mapped to the following printers:" & vbNewLine
strMsgtxt = strMsgtxt & "H: = Home Drive" & vbNewLine
msgbox = WshShell.Popup(strMsgtxt, 2, "Logon Script", 0)
End Sub


I should clarify that when I say reboots....it is actually blue screening...that is if I turn off auto reboot. The error messages are consistent with a stop error 00000025. There is no additional information in the event log. I have looked at articles dealing with the stop error but they do not apply to this particular situation.

Thanks
 
Sorry for the double post it timed out the first time but apprently posted the response anyway.

We do use Trend Micro products and I have been able to duplicate the issue even with Trend uninstalled.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top