0

Today's problem is this:

I need to extract an ISO image file for windows updates using VBScript. Reason for using VBScript is because everything in on stand-alone systems, and I'm trying to automate the process by making scripts.

That ISO file will be on a CD/DVD, via D:

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?

CodeMonkey
  • 1,136
  • 16
  • 31
  • 3
    Don't know if vbscript can do this (sorry) but you can do it with a batch file if you use 7zip for sure. – Gray Mar 19 '13 at 13:02
  • Why in the world would anyone burn an ISO file to a disc as an ISO file? ISO isn't compressed. On the contrary, an ISO file adds overhead and ends up larger than the sum of its contents. And ISO files are a pain to extract using the [Windows API](http://msdn.microsoft.com/en-us/library/windows/desktop/aa366450%28v=vs.85%29.aspx). Why don't you just burn your hotfixes onto the disc in their native .msi form? – rojo Mar 19 '13 at 13:29
  • Because we have to get the updates from one computer that connects to the internet to a stand-alone server that is not connected to the internet, and we can not use anything other than a CD/DVD to move them over. Also, we can not just move them over on a CD/DVD in the native .msi and .exe form, because there has to be an orginal file on the server that they came from, for documentation. – CodeMonkey Mar 19 '13 at 13:35
  • That still doesn't really explain why you insist on burning an ISO file as a regular file onto a CD. Windows updates aren't typically deployed via ISO. So the "original file on the server that they came from, for documentation" condition you have set for yourself should be satisfied by maintaining an archive of .msi files. If you continue to insist on making this task harder on yourself, then all we can really say is, we wish you the best of luck, and I hope you'll consider sharing your code with us once you figure out how to extract an ISO using VBScript. – rojo Mar 19 '13 at 14:35
  • I have been misinformed. The CD/DVD is the ISO, not holding the ISO as a regular file. Thank you for your comments and replies. – CodeMonkey Mar 19 '13 at 17:39

3 Answers3

1

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. 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.

I'm not sure which version of PowerShell began including the Mount-DiskImage cmdlet. It doesn't appear to be available on my Win 7 computer, which has PowerShell v2.0 installed.

Community
  • 1
  • 1
rojo
  • 24,000
  • 5
  • 55
  • 101
0

VBScript provides no function for extracting ISO images. 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? 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). That way you can simply access the files on drive D: with your script.
  • Extract the files from the ISO and burn them to a CD (if you want to add additional files). 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). You can then extract the files from the archive on drive D: like this:

    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.

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
0

I only know you can use the iso tool to extract this kind of files. Like Poweriso, magiciso and WinISO. And hope the tool will help you.