简体   繁体   English

使用vbscript提取ISO

[英]Extract ISO using vbscript

Today's problem is this: 今天的问题是这样的:

I need to extract an ISO image file for windows updates using VBScript. 我需要使用VBScript为Windows更新提取ISO映像文件。 Reason for using VBScript is because everything in on stand-alone systems, and I'm trying to automate the process by making scripts. 使用VBScript的原因是因为所有内容都位于独立系统上,因此我正在尝试通过制作脚本来自动化该过程。

That ISO file will be on a CD/DVD, via D: 该ISO文件将通过D放在CD / DVD上:

If it is possible and anyone can help me, that would be awesome! 如果有可能,任何人都可以帮助我,那将非常棒!

Although, if it is not possible, could it be done using standard windows command line, using a batch file? 虽然,如果不可能,是否可以使用标准Windows命令行,批处理文件来完成?

If your server is running Windows Server 2012 or Windows 8 and has PowerShell installed, you can use PowerShell to mount your ISO image as a drive, do what you need with the contents, then dismount. 如果您的服务器运行的是Windows Server 2012或Windows 8,并且已安装PowerShell,则可以使用PowerShell 将ISO映像作为驱动器安装 ,对内容执行所需的操作,然后卸装。 To automate the mounting without requiring user input, you'll find the command-line switches for Mount-DiskImage in Microsoft's Mount-DiskImage TechNet Article . 要自动进行挂载而不需要用户输入,您可以在Microsoft的Mount-DiskImage TechNet文章中找到Mount-DiskImage的命令行开关。

I'm not sure which version of PowerShell began including the Mount-DiskImage cmdlet. 我不确定哪个版本的PowerShell开始包含Mount-DiskImage cmdlet。 It doesn't appear to be available on my Win 7 computer, which has PowerShell v2.0 installed. 它在安装了PowerShell v2.0的Win 7计算机上似乎不可用。

VBScript provides no function for extracting ISO images. VBScript不提供提取ISO映像的功能。 And as @rojo already said in his comment: why would you burn an ISO image on a CD as a file in the first place? 正如@rojo在其评论中已经说过的:为什么首先要将CD上的ISO映像作为文件刻录? You don't gain anything by doing this. 您这样做不会获得任何收益。 More appropriate procedures are: 更合适的程序是:

  • Create a CD from the image (if you need just the files from that image). 从映像创建CD(如果仅需要该映像中的文件)。 That way you can simply access the files on drive D: with your script. 这样,您可以使用脚本简单地访问驱动器D:上的文件。
  • Extract the files from the ISO and burn them to a CD (if you want to add additional files). 从ISO中提取文件并将其刻录到CD(如果要添加其他文件)。 Access is the same as above. 访问权限与上述相同。
  • Extract the files from the ISO and pack them into a Zip archive (if you're pressed for space on the CD). 从ISO中提取文件,然后将它们打包到Zip存档中(如果您按CD上的空白键)。 You can then extract the files from the archive on drive D: like this: 然后可以从驱动器D:上的存档中提取文件,如下所示:

     Set sa = CreateObject("Shell.Application") Set zip = sa.NameSpace("D:\\your.zip") Set dst = sa.NameSpace("C:\\destination\\folder") For Each f In zip.Items dst.CopyHere(f) Next 

    Note that CopyHere is asynchronous, so it returns immediately, but you may need to wait some time for the extraction to finish. 请注意, CopyHere是异步的,因此它会立即返回,但是您可能需要等待一段时间才能完成提取。

I only know you can use the iso tool to extract this kind of files. 我只知道您可以使用iso工具提取此类文件。 Like Poweriso, magiciso and WinISO. 像Poweriso,magiciso和WinISO。 And hope the tool will help you. 希望该工具对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM