Quantcast
Channel: Hyper-V forum
Viewing all articles
Browse latest Browse all 8743

GetVirtualSystemThumbnailImage with VBScript

$
0
0

Hey All!

I am writing an HTA application (some of you may have seen some of my other questions), and I am now stuck on the thumbnail image of a VM. I am taking the VBScript example from here:

https://msdn.microsoft.com/en-us/library/cc160707(v=vs.85).aspx

with slight modifications for root\virtualization\v2, but when I run it, all I get is a WScript.Echo "Done" and a log file with "Done" in it. I see two subs in the example to write the image (SaveThumbnailImage and PrintThumbnailImage), but they are never actually called in the script. Any attempts to call those with OutParams.ImageData error with a type mismatch.

Particularly, if you copy and paste the example, the mismatch error is on line 80 with the "stream.WriteText text".

Are the [] brackets shown in the above link required when passing the data to the sub? As in: SaveThumbnailImage(objOutParams.ImageData[])

I have seen the PowerShell examples, and I can get the PowerShell example to work, but being an HTA, I need this to work with VBScript. Has anybody successfully gotten a VBScript to output a thumbnail image? Any tips on getting this to work?

Thank you in advace!

Eric

EDIT: Tried adding the brackets [], but it throws an error "Expected ')'". Doesn't seem to like the brackets.

What exactly is being created with the ADODB.stream? Is that the issue? This one is new to me. I have .NET 3.5 and .NET 4.5 installed.









Viewing all articles
Browse latest Browse all 8743

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>