Create a Network Disk ing script

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.