在 VBscript / WMI 中将挂载点与本地磁盘关联
我有一个 VBscript,可以输出有关系统的各种配置项。硬件和软件两方面。我可以输出磁盘及其关联的分区。我可以输出挂载点。我似乎无法将安装点与本地磁盘关联(它实际上是本地磁盘)。
我需要能够使用 VBscript 来完成此操作,以便适应剩余的约 2000 行代码。我不想以图形方式运行其他程序。我知道磁盘管理器服务可以向我显示(我的电脑 -> 管理 -> 磁盘管理),但这不是我需要的。我需要能够通过 VBscript 远程执行此操作。
我愿意从 VBscript 运行 .exe,并将输出传输回 VBscript 并从那里对其进行处理。
有什么想法吗? 提前致谢。
I have a VBscript that outputs various config items about a system. Both hardware and software. I can output disks and their associated partitions. I can output mount points. I do not seem to be able to associate a mount point with a local disk (where it actually is a local disk).
I need to be able to do this using VBscript, so as to fit in with the rest of the ~2000 lines of code. I do NOT want to run some other program graphically. I know the disk manager service can show me (My Computer -> Manage -> Disk Management), but this is not what I need. I need to be able to do this remotely via VBscript.
I am open to running an .exe from the VBscript and piping the output back into VBscript and massaging it from there.
Any idea's ?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定你的意思,但我想我有一个想法。您是否检查过 WMI Win32_LogicalDisktoPartition 类 。使用管理员权限从命令提示符中检查这一点。
这将为您提供类属性和方法。如果您只是运行它,它将转储所有可用的实例。
这可能会给你你所需要的。对于Windows XP,这似乎只提到带有启动分区的磁盘。在 Vista 和更新版本中,它似乎列出了所有内容,包括光盘。问题是我一直发现此信息没有帮助,除非您知道 Disk0、Disk1、Disk(N) 是什么,而且除了特定的计算机到计算机机箱之外,这种情况很少见。如果有用的话,可以很容易地将其放入使用 VBScript 的 WMI 调用中。希望有帮助。
I am not sure what you mean, but I think I have an idea. Have you checked out the the WMI class Win32_LogicalDisktoPartition. Check this out from a command prompt with admin privileges.
That will give you the class properties and methods. If you just run this, it will dump all the instances available.
This might give you what you need. For Windows XP, this only seems to mention the disk with the boot partition. On Vista and newer, it seems to list everything, including optical disk. Problem is I have always found this info to be unhelpful unless you know what Disk0, Disk1, Disk(N) is, and that is rare beyond a specific computer to computer case. If it is useful, this is easy to put into a WMI call with VBScript. Hope it helps.