{"id":2869,"date":"2010-07-21T11:08:33","date_gmt":"2010-07-21T07:08:33","guid":{"rendered":"http:\/\/msbro.ru\/?p=2869"},"modified":"2010-07-03T11:11:02","modified_gmt":"2010-07-03T07:11:02","slug":"poluchit-spisok-ustanovlennogo-softa-cherez-vbs","status":"publish","type":"post","link":"https:\/\/msbro.ru\/index.php\/archives\/2869","title":{"rendered":"\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0444\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 vbs"},"content":{"rendered":"<p>\u042d\u0442\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u043c\u0430\u0448\u0438\u043d\u044b \u0441\u0434\u0430\u044e\u0442 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440:<\/p>\n<p><!--more--><\/p>\n<pre>em BEGIN\r\n\r\nconst HKLM = &amp;H80000002\r\n\r\non Error resume next\r\n\r\noutCon=right(LCase(wScript.FullName),11)=\"cscript.exe\"\r\n\r\noutFile=\"\"\r\nout_all=0\r\n\r\nFMT=1\r\n' 0 - Text\r\n' 1 - CSV\r\n' 2 - HTM\r\n\r\nstrKey = \"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\\"\r\n\r\nSet objReg = GetObject(\"winmgmts:\/\/.\/root\/default:StdRegProv\")\r\nobjReg.EnumKey HKLM, strKey, arrSubkeys\r\n\r\nS=\"\"\r\nT=\"\"\r\nT=out(T,\"INSTDATE\",11,FMT&lt;&gt;3)\r\nT=out(T,\"VER\",8,FMT&lt;&gt;3)\r\nT=out(T,\"NAME\",0,FMT&lt;&gt;3)\r\noutstr(T)\r\n\r\nfor each strSubkey in arrSubkeys\r\n  T=\"\"\r\n  AppName=\"\"\r\n  InstDate=\"\"\r\n  verMajor=\"\"\r\n  verMinor=\"\"\r\n  ver=\"\"\r\n  Siz=\"\"\r\n\r\n  if objReg.GetStringValue(HKLM, strKey &amp; strSubkey, \"DisplayName\", AppName) &lt;&gt; 0 then\r\n     objReg.GetStringValue HKLM, strKey &amp; strSubkey, \"QuietDisplayName\", AppName\r\n  end if\r\n\r\n  if len(AppName)&gt;0 then\r\n     objReg.GetStringValue HKLM, strKey &amp; strSubkey, \"InstallDate\", InstDate\r\n     objReg.GetDWORDValue HKLM, strKey &amp; strSubkey, \"VersionMajor\", verMajor\r\n     objReg.GetDWORDValue HKLM, strKey &amp; strSubkey, \"VersionMinor\", verMinor\r\n     objReg.GetDWORDValue HKLM, strKey &amp; strSubkey, \"EstimatedSize\", Siz\r\n\r\n     ver=verMajor &amp; \".\" &amp; verMinor\r\n     if ver=\".\" then ver=\"\"\r\n\r\n     T=out(T,InstDate,11,FMT&lt;&gt;3)\r\n     T=out(T,ver,10,FMT&lt;&gt;3)\r\n     T=out(T,AppName,0,FMT&lt;&gt;3)\r\n     outstr(T)\r\n  end if\r\nnext\r\noutEnd()\r\n\r\nfunction out(Ret, T, N, Q)\r\n  if IsNull(T) then T=\"\"\r\n  if Q then\r\n     select case FMT\r\n       case 0\r\n         if N&gt;0 then\r\n            if N&gt;len(T) then Ret=Ret &amp; T &amp; space(N-len(T))\r\n            if N0 then Ret=Ret &amp; \",\"\r\n         Ret=Ret &amp; qw(T)\r\n       case 2\r\n         if len(T)=0 then T=\"\u00a0\"\r\n         Ret=Ret &amp; \"\r\n\" &amp; T &amp; \"\r\n\r\n\" &amp; vbCrLf\r\n     end select\r\n  end if\r\n  out=Ret\r\nend function\r\n\r\nsub outstr(text)\r\n  if FMT=2 then\r\n     text=\"\r\n\" &amp; vbCrLf &amp; text &amp; \"  \r\n\r\n\"\r\n     if len(S)=0 then\r\n        text=\"\" &amp; vbCrLf &amp; \"\r\n\r\n<table border=\"1\" cellspacing=\" &amp; qw(\">\" &amp; vbCrLf &amp; text\r\n     end if\r\n  end if\r\n\r\n  if outCon then\r\n     if len(outFile)=0 then\r\n        wScript.echo text\r\n     end if\r\n  end if\r\n  S=S &amp; text &amp; vbCrLf\r\nend sub\r\n\r\nsub outEnd\r\n  T=\"<\/table>\r\n\r\n\r\n\" &amp; vbCrLf &amp; \"\" &amp; vbCrLf\r\n  if FMT=2 then S=S &amp; T\r\n\r\n  if not outCon then\r\n     if len(outFile)=0 then WScript.echo(S)\r\n  else\r\n     if FMT=2 then\r\n        if len(outFile)=0 then WScript.echo T\r\n     end if\r\n  end if\r\n\r\n  if len(outFile)&gt;0 then\r\n     set fso=CreateObject(\"Scripting.FileSystemObject\")\r\n     set file=fso.OpenTextFile(outFile, 2, true)\r\n     file.write(S)\r\n     file.close\r\n  end if\r\nend sub\r\n\r\nfunction qw(T)\r\n  qw=chr(34) &amp; T &amp; chr(34)\r\nend function\r\n<\/pre>\n<p>(\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a &#8211; \u0441 \u0444\u043e\u0440\u0443\u043c\u0430 sysadmins.ru)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u042d\u0442\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u043c\u0430\u0448\u0438\u043d\u044b \u0441\u0434\u0430\u044e\u0442 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440:<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,10],"tags":[711],"class_list":["post-2869","post","type-post","status-publish","format-standard","hentry","category-windows","category-scripts","tag-vbs"],"_links":{"self":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts\/2869"}],"collection":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/comments?post=2869"}],"version-history":[{"count":0,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/posts\/2869\/revisions"}],"wp:attachment":[{"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/media?parent=2869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/categories?post=2869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/msbro.ru\/index.php\/wp-json\/wp\/v2\/tags?post=2869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->