ellsworth2000
asked on
When using VBScript: nUser.MapNetworkDrive "I:", "\\Server\Share", how do you make the drive persistant?
Good Day Experts,
When using VBScript: nUser.MapNetworkDrive "I:", "\\Fax\Scans", how do you make the drive persistant? This is the whole script:
On Error Resume Next
'
' Set constants and variables
'
Dim wshShell
Dim Domain
Dim UserName
Dim nUser
Set wshShell = WScript.CreateObject("Wscr ipt.Shell" )
Set nUser = WScript.CreateObject("Wscr ipt.Networ k")
Domain = nUser.UserDomain
UserName = nUser.UserName
'
' Map Company Folder
'
nUser.MapNetworkDrive "I:", "\\Server\Share"
nUser.MapNetworkDrive "J:", "\\Server\Share2"
'
'Clean Up
'
Set UserName=Nothing
Set nUser=Nothing
Set Domain=Nothing
__________________________ __________ _End Script
When using VBScript: nUser.MapNetworkDrive "I:", "\\Fax\Scans", how do you make the drive persistant? This is the whole script:
On Error Resume Next
'
' Set constants and variables
'
Dim wshShell
Dim Domain
Dim UserName
Dim nUser
Set wshShell = WScript.CreateObject("Wscr
Set nUser = WScript.CreateObject("Wscr
Domain = nUser.UserDomain
UserName = nUser.UserName
'
' Map Company Folder
'
nUser.MapNetworkDrive "I:", "\\Server\Share"
nUser.MapNetworkDrive "J:", "\\Server\Share2"
'
'Clean Up
'
Set UserName=Nothing
Set nUser=Nothing
Set Domain=Nothing
__________________________
ASKER
Thank You for your Reply Chris-Dent,
what is the profile? And where should the: objNetwork.MapNetworkDrive strDrive, strShare, True be inserted to?
Many Thanks,
Ellsworth
what is the profile? And where should the: objNetwork.MapNetworkDrive
Many Thanks,
Ellsworth
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Perfect!!! Thanks Chris.
No problem :)
Chris
Hi,
You need to update the profile with the mapping. MapNetworkDrive accepts a third parameter for that:
objNetwork.MapNetworkDrive
The default for that is False (which is non-persistant).
Chris