Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Set clDrives = WshNetwork.EnumNetworkDrives
For i = 0 to clDrives.Count -1 Step 2
WSHNetwork.RemoveNetworkDrive clDrives.Item(i), True, True
Next
'Give the PC time to do the disconnect, wait 300 milliseconds
wscript.sleep 900
'Map drives and printers needed by all
'Note the first command uses the user name as a variable to map to a user share.
WSHNetwork.MapNetworkDrive "U:", "\\Data\users$\" & UserString,True
WSHNetwork.MapNetworkDrive "S:", "\\data\Coinc$",False
Do you receive any errors? How were the drives set up originally? I have seen problems in the past where mappings that were done manually get "stuck" and need to be removed from the registry. Can you manually disconnect the drive? If so what happens when you then run the script via GPO? Why don't you share the user folders directly?I run the login scripts via GPO and it always fails
On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("Wscript.Shell")
Set oFolder = objFSO.GetFolder("E:\Shares")
Set oSubfolders = oFolder.SubFolders
For Each oSubFolder In oSubFolders
cmdString ="net share " & oSubFolder.name& "=E:\Shares\" & oSubFolder.name& " /GRANT:" & oSubFolder.name &",FULL"
WshShell.Run("CMD.EXE /C " & cmdString)
Next
If Err.Number <> 0 Then
Wscript.Echo "A problem was encountered sharing folders"
Else
Wscript.Echo "Folders shared successfully"
End If
The scripts listed on my site are contained within my Admin Script Pack and are available to my customers. A one time subscription gets you lifetime of updates to the Admin Script Pack. Please use the contact information from the site to discuss further if you have any questions regarding those scripts.Btw: are any of the scripts from your site available?