Link to home
Start Free TrialLog in
Avatar of chilemoore
chilemoore

asked on

Windows 10 and vbs Logon scripts?

I'm reviewing some logon scripts which work great on windows 7 but don't seem to be working on windows 10.  

Here is the script.  Removed a few elements I'm not using:

Option Explicit
Dim WshNetwork, Drives, strDriveLetter, strDriveLetter1, strDriveLetter2
Dim strRemotePath1, strRemotePath2, MyUser, i
Dim objShell

WScript.Sleep 500

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

MyUser = WshNetwork.UserName
strDriveLetter1 = "S:"
strDriveLetter2 = "U:"
strRemotePath1 = "\\domain.lan\SharedDocs"
strRemotePath2 = "\\domain.lan\SharedDocs\Users\" & MyUser

' Map Network Drive
' -----------------------------------------------------------------'

On Error Resume Next
WshNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1, True
WshNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2, True
'WshNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3, True

' Run gupdate

Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("c:\windows\system32\gpupdate.exe"),0,True
Set objShell = Nothing


Wscript.Quit

Anyone run into this issue?
ASKER CERTIFIED SOLUTION
Avatar of McKnife
McKnife
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chilemoore
chilemoore

ASKER

I ended up doing a split approach.   Thanks.