8/31/2023 0 Comments Drive mapping![]() The example script below takes this a stage further, disconnecting the drive letter first (and coded to cope with persistent and/or disconnected drive shares)ĭriveMap.vbs - Connect a local drive letter to a remote file shareįor workgroup machines sharing files via pass-thru authentication with no domain login script, a persistent drive map can be used. MapNetworkDrive('H:', $RemoteShare, $false) $network = New-Object -ComObject WScript.Network To run these commands in PowerShell without calling cscript: MapNetworkDrive "H:", strRemoteShare, False Set objNetwork = WScript.CreateObject(" WScript.Network") Persistent : True/False - store the mapping persistently in the users profile StrRemoteShare : The UNC path to the remote drive \\MyServer\MyPrinter ObjNetwork.MapNetworkDrive( strLocalDrive, strRemoteShare,, , )
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |