Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Client User Logon Script wont load in Windows 7

Avatar of jjohnson502
jjohnson502 asked on
Microsoft Legacy OSVB ScriptWindows 7
4 Comments1 Solution736 ViewsLast Modified:
Having issues loading a startup script in Windows 7. It basically assigns a netwrok drive based on the security group you are associatd with. I cant get this to load on any windows 7 machine. If i manually lauch it, it works just fine. Any ideas?

On Error Resume Next
 
Set WshNetwork = CreateObject("WScript.Network")
 
DomainString = WshNetwork.UserDomain
UserString = WshNetwork.UserName
 
Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)
 
'unmap all drives
WshNetwork.RemoveNetworkDrive "m:",true,true
WshNetwork.RemoveNetworkDrive "n:",true,true
WshNetwork.RemoveNetworkDrive "o:",true,true
WshNetwork.RemoveNetworkDrive "p:",true,true
WshNetwork.RemoveNetworkDrive "q:",true,true
WshNetwork.RemoveNetworkDrive "s:",true,true
WshNetwork.RemoveNetworkDrive "u:",true,true
WshNetwork.RemoveNetworkDrive "W:",true,true
WshNetwork.RemoveNetworkDrive "z:",true,true

 
 
For Each GroupObject In UserObj.Groups
      Select Case GroupObject.Name
            Case "ADMIN"
                  WshNetwork.MapNetworkDrive "z:", "\\server\ADMIN"
            Case "MANAGEMENT"
                  WshNetwork.MapNetworkDrive "m:", "\\server\MANAGEMENT"
            Case "OFFICE"
                  WshNetwork.MapNetworkDrive "o:", "\\server\OFFICE"
            Case "SALES"
                  WshNetwork.MapNetworkDrive "s:", "\\server\SALES"
            Case "QUALITY"
                  WshNetwork.MapNetworkDrive "q:", "\\server\QUALITY"
      

      End Select

Next


Set objNetwork = Wscript.CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection "\\server\Brother"
objNetwork.AddWindowsPrinterConnection "\\server\Brother2"
objNetwork.AddWindowsPrinterConnection "\\server\HP"
objNetwork.AddWindowsPrinterConnection "\\server\Kyocera"
objNetwork.SetDefaultPrinter ("\\server\Kyocera")

WScript.Quit
ASKER CERTIFIED SOLUTION
Avatar of Martin Kühn
Martin KühnFlag of Germany imageSystem Administrator

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answers