In the domain environment, the user's desktop automatically obtains a network disk.
When a user logs on to the system, the system checks whether the file server has its own shared folder. You can save it as batch processing as follows:
@ Echo off
If not exist "\ partition file \ new \ % username %" mkdir "\ partition file \ new \ % username %"
Exit
Second, create a disk sharing path
Option explicit
Dim objnetwork, objshell
Dim strsharedrive, strsharedrivepath, strusername, struserdomain
Strsharedrive = "J :"
Strsharedrivepath = "\ sharefile \ new \"
'Strsharedrivepath is the Network Disk sharing path.
Set objnetwork = wscript. Createobject ("wscript. Network ")
Strusername = objnetwork. Username
Objnetwork. mapnetworkdrive strsharedrive, strsharedrivepath & strusername
Set objshell = Createobject ("Shell. Application ")
Objshell. namespace (strsharedrive). Self. Name = "workspace"
Wscript. Quit
Save the above Code as "drivepath. vbs" and add the two scripts to the logon policy.
This article is from the "talk about virtual" blog. For more information, contact the author!
Create a Network Disk ing script