Laufwerksmapping

 

Batch-Befehl

netuse h: \\server\freigabe
net use /persistent:no X: \\server\freigabe passwort /user:Domäne\Benutzername
Zum Löschen einer Verbindung:
net use X: /delete 

PowerShell-Befehl

$driveLetter = "H"
$serverPath = "\\server\freigabe"
$credential = Get-Credential
New-PSDrive -Name $driveLetter -PSProvider FileSystem -Root $serverPath -Persist -Credential $credential

VBScript

Dim objNetwork, strDriveLetter, strRemotePath, strUser, strPassword
strDriveLetter = "H"
strRemotePath = "\\server\freigabe"
strUser = "DeinBenutzername"
strPassword = "DeinKennwort"

Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, False, strUser, strPassword