{"id":65763,"date":"2007-01-10T06:34:00","date_gmt":"2007-01-10T06:34:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2007\/01\/10\/hey-scripting-guy-how-can-i-retrieve-the-subject-property-for-a-msi-file\/"},"modified":"2007-01-10T06:34:00","modified_gmt":"2007-01-10T06:34:00","slug":"hey-scripting-guy-how-can-i-retrieve-the-subject-property-for-a-msi-file","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-how-can-i-retrieve-the-subject-property-for-a-msi-file\/","title":{"rendered":"Hey, Scripting Guy! How Can I Retrieve the Subject Property for a .MSI File?"},"content":{"rendered":"<h2><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Question\" border=\"0\" title=\"Hey, Scripting Guy! Question\" class=\"nearGraphic\" \/> <\/h2>\n<p>Hey, Scripting Guy! How can I retrieve the Subject property for a .MSI file?<\/p>\n<p>&#8212; J L-G<\/p>\n<p><img decoding=\"async\" height=\"5\" width=\"5\" src=\"https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/05\/spacer.gif\" alt=\"Spacer\" border=\"0\" \/><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Answer\" border=\"0\" title=\"Hey, Scripting Guy! Answer\" class=\"nearGraphic\" \/><a href=\"http:\/\/go.microsoft.com\/fwlink\/?linkid=68779&amp;clcid=0x409\"><img decoding=\"async\" height=\"288\" width=\"120\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/ad.jpg\" align=\"right\" alt=\"Script Center\" border=\"0\" title=\"Script Center\" class=\"farGraphic\" \/><\/a><\/p>\n<p>Hey, J L-G. Before you ask, the Scripting Guy who writes this column has no comment on the January 8<sup>th<\/sup> Florida-Ohio State football game. That&rsquo;s primarily because this Scripting Guy refuses to recognize the &ldquo;Bowl Championship Series&rdquo; as being anything other than a bunch of football games. National championship? Not without a playoff; no way. (And had there <i>been <\/i>a playoff, USC would likely have won it all, as painful as that is to admit.)<\/p>\n<p>Besides, the Scripting Guy who writes this column doesn&rsquo;t like either Florida <i>or<\/i> Ohio State; he only watched the game because, well, what <i>else<\/i> are you supposed to do in the evenings? <\/p>\n<p>What&rsquo;s that? Read a book, do household chores, spend quality time with the family? Hey, <i>we&rsquo;re<\/i> supposed to be the comedians around here!<\/p>\n<table cellpadding=\"0\" cellspacing=\"0\" class=\"dataTable\" id=\"EPD\">\n<thead><\/thead>\n<tbody>\n<tr valign=\"top\" class=\"record\">\n<td>\n<p><b>Note<\/b>. For those of you keeping track, yes, just <a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/resources\/qanda\/jan07\/hey0109.mspx\"><b>yesterday<\/b><\/a> the Scripting Guy who writes this column noted that he didn&rsquo;t like the Dallas Cowboys. And yes, he&rsquo;s also pointed out that he doesn&rsquo;t like the Oakland Raiders. And &ndash; well, to simplify matters, let&rsquo;s put it this way: other than the Washington Huskies and (usually) the Seattle Seahawks and the Seattle Mariners, the Scripting Guy who writes this column doesn&rsquo;t like anybody or anything.<\/p>\n<p>And if the Mariners continue to shell out millions of dollars to relief pitchers who go <a target=\"_blank\" href=\"http:\/\/seattle.mariners.mlb.com\/NASApp\/mlb\/news\/article.jsp?ymd=20070105&amp;content_id=1773722&amp;vkey=news_sea&amp;fext=.jsp&amp;c_id=sea\"><b>1-2 with an 8.68 ERA<\/b><\/a>, well &hellip;.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"dataTableBottomMargin\"><\/div>\n<p>Of course, if we aren&rsquo;t going to talk about college football then what <i>can<\/i> we talk about? Retrieving the Subject property for a .MSI file? Well, sure, we can do that. But we have to warn you, there really isn&rsquo;t much to talk about:<\/p>\n<pre class=\"codeSample\">Set objInstaller = CreateObject(\"WindowsInstaller.Installer\") \nSet objProduct = objInstaller.SummaryInformation(\"C:\\Scripts\\FP11.MSI\")\n\nWscript.Echo \"Subject: \" &amp; objProduct.Property(3)<\/pre>\n<p>Like we said, there isn&rsquo;t much to discuss here. We start out by creating an instance of the <b>WindowsInstaller.Installer<\/b> object; that&rsquo;s an object that can bind to &ndash; and retrieve information from &ndash;.MSI files. We then use this line of code to grab all the <b>SummaryInformation<\/b> values for the file C:\\Scripts\\FP11.MSI:<\/p>\n<pre class=\"codeSample\">Set objProduct = objInstaller.SummaryInformation(\"C:\\Scripts\\FP11.MSI\")<\/pre>\n<p>After that we simply echo back the value of property <b>3<\/b>, which just happens to be the value of the <b>Subject<\/b> property:<\/p>\n<pre class=\"codeSample\">Wscript.Echo \"Subject: \" &amp; objProduct.Property(3)<\/pre>\n<p>That&rsquo;s going to give us output similar to this:<\/p>\n<pre class=\"codeSample\">Subject: Microsoft Office FrontPage 2003<\/pre>\n<p>Pretty slick, huh?<\/p>\n<p>And sure, you can retrieve other types of summary information using the WindowsInstaller.Installer object. In fact, you can retrieve all these summary information values:<\/p>\n<pre class=\"codeSample\">Set objInstaller = CreateObject(\"WindowsInstaller.Installer\") \nSet objProduct = objInstaller.SummaryInformation(\"C:\\Scripts\\FP11.MSI\")\n\nWscript.Echo \"Code page: \" &amp;objProduct.Property(1)\nWscript.Echo \"Title: \" &amp; objProduct.Property(2)\nWscript.Echo \"Subject: \" &amp; objProduct.Property(3)\nWscript.Echo \"Author: \" &amp; objProduct.Property(4)\nWscript.Echo \"Keywords: \" &amp; objProduct.Property(5)\nWscript.Echo \"Comment: \" &amp; objProduct.Property(6)\nWscript.Echo \"Template: \" &amp; objProduct.Property(7)\nWscript.Echo \"Last Author: \" &amp; objProduct.Property(8)\nWscript.Echo \"Revision number: \" &amp; objProduct.Property(9)\nWscript.Echo \"Edit Time: \" &amp; objProduct.Property(10)\nWscript.Echo \"Last Printed: \" &amp; objProduct.Property(11)\nWscript.Echo \"Creation Date: \" &amp; objProduct.Property(12)\nWscript.Echo \"Last Saved: \" &amp; objProduct.Property(13)\nWscript.Echo \"Page Count: \" &amp; objProduct.Property(14)\nWscript.Echo \"Word Count: \" &amp; objProduct.Property(15)\nWscript.Echo \"Character Count: \" &amp; objProduct.Property(16)\nWscript.Echo \"Application Name: \" &amp; objProduct.Property(18)\nWscript.Echo \"Security: \" &amp; objProduct.Property(19)\n<\/pre>\n<pre class=\"codeSample\"><span style=\"font-family: arial black,avant garde\"><span style=\"font-family: arial,helvetica,sans-serif\">Two things we should note. First, this only works for .MSI files; you can&rsquo;t use same script to retrieve summary information for, say, a .JPG file. (So how <i>can<\/i> you retrieve summary information for a .JPG file? Well, here&rsquo;s <\/span><\/span><a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/resources\/qanda\/jan07\/hey0105.mspx\"><span style=\"font-family: arial black,avant garde\"><span style=\"font-family: arial,helvetica,sans-serif\">one way<\/span><\/span><\/a><span style=\"font-family: arial black,avant garde\"><span style=\"font-family: arial,helvetica,sans-serif\">.)<\/span><br \/><\/span><span style=\"font-family: arial,helvetica,sans-serif\">Second, some of these property names are misleading; for example, <b>Word Count<\/b> actually refers to the type of source image file you&rsquo;re dealing with, and has nothing to do with the number of words in the .MSI file. For more information,<\/span> <br \/>take a peek at the <a target=\"_blank\" href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/aa372046.aspx\"><b>Windows Installer Reference documentation<\/b><\/a> on MSDN.<\/pre>\n<p>Oh, and one more <span style=\"font-family: arial,helvetica,sans-serif\">thing<\/span>: this object works only on the local computer. For better or worse, you can&rsquo;t create a remote instance of WindowsInstaller.Installer.<\/p>\n<p>Now, where were we? Oh, yes. To be honest, the Florida-Ohio State game was pretty dull; there was a flurry of action early on, but after that Ohio State all-but disappeared. From then on the only excitement for the evening occurred, at least for those of us in the Seattle area, when commercials for one of the local news channel aired. &ldquo;LOWLAND SNOW!!!!! GUSTS OF WINDS TOPPING 40 MILES AN HOUR!!!! BITTER ARCTIC COLD!!!!! WE&rsquo;RE ALL GOING TO DIE!!!!!&rdquo; <\/p>\n<p>Holy smokes; are we headed for the Apocalypse or what?<\/p>\n<p>As it turns out, the Seattle area could get some high winds, though nothing like the sustained windstorm of a few weeks ago. And, after the wind dies down, we <i>might<\/i> get a little snow, though, then again, we might not. As for bitter, arctic cold? Well, that part <i>is<\/i> true, as long as you consider highs in the 30s and lows in the mid 20s as being &ldquo;bitter arctic cold.&rdquo; Let&rsquo;s just hope that the Seattle area never gets hit by a <i>real<\/i> emergency. After all, instead of being the voice of calm and reason our local news channels will probably encourage everyone to riot in the streets and to loot all the local stores. &ldquo;IT&rsquo;S EVERY MAN FOR HIMSELF!!!!! KILL OR BE KILLED!!!!! EVERYONE START PANICKING RIGHT NOW!!!!!&rdquo;<\/p>\n<p>On the bright side, though, having previously hosted the <a target=\"_blank\" href=\"http:\/\/en.wikipedia.org\/wiki\/WTO_Ministerial_Conference_of_1999_protest_activity\"><b>World Trade Organization Ministerial Conference<\/b><\/a>, well, rioting and looting is one thing we Seattleites <i>are<\/i> prepared for.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, Scripting Guy! How can I retrieve the Subject property for a .MSI file? &#8212; J L-G Hey, J L-G. Before you ask, the Scripting Guy who writes this column has no comment on the January 8th Florida-Ohio State football game. That&rsquo;s primarily because this Scripting Guy refuses to recognize the &ldquo;Bowl Championship Series&rdquo; as [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[16,47,3,5],"class_list":["post-65763","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-desktop-management","tag-general-management-tasks","tag-scripting-guy","tag-vbscript"],"acf":[],"blog_post_summary":"<p>Hey, Scripting Guy! How can I retrieve the Subject property for a .MSI file? &#8212; J L-G Hey, J L-G. Before you ask, the Scripting Guy who writes this column has no comment on the January 8th Florida-Ohio State football game. That&rsquo;s primarily because this Scripting Guy refuses to recognize the &ldquo;Bowl Championship Series&rdquo; as [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/65763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=65763"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/65763\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=65763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=65763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=65763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}