返回列表 发帖

[问题求助] 【已解决】vbs 有关for each ……in的用法

本帖最后由 pcl_test 于 2016-11-3 16:43 编辑
Dim WSHShell'定义变量
set WSHShell=CreateObject("WScript.shell") '创建一个能与操作系统沟通的对象WSHShell
Dim fso,dc
Set fso=CreateObject("Scripting.FileSystemObject")'创建文件系统对象
set dc=fso.Drives '获取所有驱动器盘符
For Each d in dc
Dim str
WSHShell.run("net share"&d.driveletter &"$ /delete")'关闭所有驱动器的隐藏共享
next
WSHShell.run("net share admin$ /delete")
WSHShell.run("net share ipc$ /delete")'关闭admin$和ipc$管道共享 COPY
在网上找到以上代码,请问:“For Each d in dc ”这句里面的“d”是哪来的?而且为什么是“d",不是“a”,也不是“c”?
赞成“拿来主义”,但是鄙视“伸手党”

回复 2# forfiles


试过了,报错。但是还是不明白。
赞成“拿来主义”,但是鄙视“伸手党”

TOP

谢谢,各位。
赞成“拿来主义”,但是鄙视“伸手党”

TOP

返回列表