使用vbs脚本添加域网络共享驱动器
MapNetworkDrive Method
Adds a shared network drive to your computer system.
object.MapNetworkDrive(strLocalName, strRemoteName, [bUpdateProfile], [strUser], [strPassword])
Arguments
object
WshNetwork object.
strLocalName
String value indicating the name by which the mapped drive will be known locally.
strRemoteName
String value indicating the share's UNC name (\xxx\yyy).
bUpdateProfile
Optional. Boolean value indicating whether the mapping information is stored in the current user's profile. If bUpdateProfile is supplied and has a value of true, the mapping is stored in the user profile (the default is false).
strUser
Optional. String value indicating the user name. You must supply this argument if you are mapping a network drive using the credentials of someone other than the current user.
strPassword
Optional. String value indicating the user password. You must supply this argument if you are mapping a network drive using the credentials of someone other than the current user.
Remarks
An attempt to map a non-shared network drive results in an error.
Example
The following code maps the logical drive "E" to a network share with the UNC name "\Server\Public."
VBScript
Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "E:", "\Server\Public"
'
WshNetwork.mapNetworkDrive "W:", "\192.168.123.200\it部常用软件",true,"KD","KD"
JScript
var WshNetwork = WScript.CreateObject("WScript.Network");
WshNetwork.MapNetworkDrive ("E:", "\\Server\Public");
使用vbs脚本添加域网络共享驱动器的更多相关文章
- Windows系统使用vbs脚本或bat脚本强制杀死指定所有进程 vbs实现循环持续写入内容到vbs打开开的记事本 使用vbs、bat添加windows计划任务 使用cmd schtasks命令添加windows计划任务
以下脚本windows7下成功运行过,脚本也可以windows计划任务程序一起组合使用 新建一个记事本文档粘贴下面代码后将新建的记事本文档重命名下面对应的脚本名就能使用了: 添加windows计划任务 ...
- Vbs脚本经典教材(转)
Vbs脚本经典教材(最全的资料还是MSDN) —为什么要使用Vbs? 在Windows中,学习计算机操作也许很简单,但是很多计算机工作是重复性劳动,例如你每周也许需要对一些计算机文件进行复制.粘贴.改 ...
- Vbs 脚本编程简明教程之一
—为什么要使用 Vbs ? 在 Windows 中,学习计算机操作也许很简单,但是很多计算机工作是重复性劳动,例如你每周也许需要对一些计算机文件进行复制.粘贴.改名.删除,也许你每天启动 计算机第一件 ...
- Vbs脚本经典教材
转载:http://www.cnblogs.com/BeyondTechnology/archive/2011/01/10/1932440.html Vbs脚本经典教材(最全的资料还是MSDN) —为 ...
- 网络共享服务(三)之SAMBA
前面说到了FTP和NFS,由于FTP是客户端和服务器基于ftp应用协议进行交换数据的,它不支持挂载共享目录的方式,而NFS又不支持跨平台,所以就催生了第三种网络共享服务:samba Samba是在Li ...
- 网络共享服务(一)之FTP
网络共享服务:ftp,nfs,samba比较 从跨平台角度说, samba, ftp差不多, 而nfs不支持windows平台 从挂载角度说, samba, nfs可以把远程目录挂载到本地目录上, 对 ...
- Windows网络共享权限设置
文件共享权限有两种权限设置,只要理解这两种权限设置就可以在域控灵活运用. 第一种是网络共享权限 共享权限是控制用户通过网络访问共享文件夹的手段,共享权限仅当用户通过网络访问时才有效,本地用户不受此权限 ...
- VBS脚本病毒特点及如何防范3(转)
5.Vbs病毒生产机的原理介绍 所谓病毒生产机就是指可以直接根据用户的选择产生病毒源代码的软件.在很多人看来这或许不可思议,其实对脚本病毒而言它的实现非常简单. 脚本语言是解释执行的.不需要编译,程序 ...
- Microsoft Dynamics CRM 2011 批量添加域用户 然后添加CRM用户
一.先了解下 DSADD user命令详解 常见的批量创建用户的方法有四种: 一. 帐户模板的方式 二. CSVDE和LDIFDE 三. 脚本的方式 四. DSADD 但是很少有详细的资料使用DSAD ...
随机推荐
- Linux内核升级
一.测试环境 CentOS6.5 X86 64位 内核版本为 2.6.32 VM 10.07 二.编译内核版本 2.1.kernel 3.2.71 2.2.kernel 3.4.108 2.3.ker ...
- Invalid embedded descriptor for ".proto".Dependencies passed (Protobufer)解决办法
前言 之前开发的时候,发现居然出现了Dependencies passed to FileDescriptor.buildFrom() don't match those listed in the ...
- 解析汽车B2C商城网站四种盈利模式
汽车已成为家庭的日常用品,汽车的配套设施也成为销售的热点,汽车B2C电子商城为行业营销的新平台,汽车B2C电子商务网站盈利的模式是怎样的?创新的盈利模式才能在行业竞争中生存. 资讯产品一体模式 网站的 ...
- C#操作Cookie
/* 创建者:菜刀居士的博客 * 创建日期: 2014年09月02号 * 功能:操作Cookie * */ namespace Net.String.ConsoleApplication { ...
- PPPOE 模拟环境搭建
这段时间.包含我自己測试OTT盒子 PPPOE的时候比較痛苦.要不就是在别人的位置上測试.要不就是借用PPPOE的设备,认为还是自己搭建一个PPPOE真实拨号上网的环境多好! 可是坑爹的win7找不到 ...
- C#List<long>与String(Linq)
1.string => List<long> string ShopIds = "1,2,3"; var ShopIdList = ShopIds.Split(' ...
- ContentType ,charset和pageEncoding的区别(转)
========================说法一=========================== ContentType 属性指定响应的 HTTP 内容类型.如果未指定 ContentTy ...
- Date和String类型的相互转换
String转Date: SimpleDateFormat bartDateFormat = new SimpleDateFormat("MM-dd-yyyy"); String ...
- Codeforces 549G. Happy Line 馋
非常有趣的贪婪: Let's reformulate the condition in terms of a certain height the towers, which will be on t ...
- 忘记root密码时如何重设密码
哈哈,太久没用linux了,把自己的登陆密码给忘了.今天找了下方法如何重设密码以登陆系统. 此文仅以作备忘. 忘记linux密码时,可以使用单用户模式进入linux,修改root密码.1.在linux ...