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.Netw ork")
Set Drives = WshNetwork.EnumNetworkDriv es
MyUser = WshNetwork.UserName
strDriveLetter1 = "S:"
strDriveLetter2 = "U:"
strRemotePath1 = "\\domain.lan\SharedDocs"
strRemotePath2 = "\\domain.lan\SharedDocs\U sers\" & MyUser
' Map Network Drive
' -------------------------- ---------- ---------- ---------- ---------'
On Error Resume Next
WshNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1, True
WshNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2, True
'WshNetwork.MapNetworkDriv e strDriveLetter3, strRemotePath3, True
' Run gupdate
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("c:\windows\s ystem32\gp update.exe "),0,True
Set objShell = Nothing
Wscript.Quit
Anyone run into this issue?
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.Netw
Set Drives = WshNetwork.EnumNetworkDriv
MyUser = WshNetwork.UserName
strDriveLetter1 = "S:"
strDriveLetter2 = "U:"
strRemotePath1 = "\\domain.lan\SharedDocs"
strRemotePath2 = "\\domain.lan\SharedDocs\U
' Map Network Drive
' --------------------------
On Error Resume Next
WshNetwork.MapNetworkDrive
WshNetwork.MapNetworkDrive
'WshNetwork.MapNetworkDriv
' Run gupdate
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("c:\windows\s
Set objShell = Nothing
Wscript.Quit
Anyone run into this issue?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER