Site icon WinCert

Block autoplay for network share drives

To block autoplay feature for network shares, here’s what you can do..

You can use a logon script below, which maps the drive and creates a shortcut on the users desktop.

Dim WshNetwork,objFSO
WshNetwork.MapNetworkDrive “W:”, “\\server1\Accounting$”,True
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
strDsk = WshShell.SpecialFolders(“Desktop”)
‘ What is the label for the shortcut?
strshortcut = strDsk & “\Accounting.lnk”
If Not objFSO.FileExists(strshortcut) Then
SET oUrlLink = WshShell.CreateShortcut(strshortcut)
‘ What is the path to the shared folder?
oUrlLink.TargetPath = “\\server1\Accounting$\
oUrlLink.Save
End If

This should block the autoplay feature.

Exit mobile version