<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>いんちきTech &#187; VBScript</title>
	<atom:link href="http://it.snds.jp/tag/vbscript/feed" rel="self" type="application/rss+xml" />
	<link>http://it.snds.jp</link>
	<description>略してIT</description>
	<lastBuildDate>Thu, 15 Sep 2011 05:27:59 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://it.snds.jp/tag/vbscript/feed" />
		<item>
		<title>Office の「最近使ったファイル」を削除する</title>
		<link>http://it.snds.jp/software/805.html</link>
		<comments>http://it.snds.jp/software/805.html#comments</comments>
		<pubDate>Fri, 20 Aug 2010 06:19:21 +0000</pubDate>
		<dc:creator>きく</dc:creator>
				<category><![CDATA[Office]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[スクリプト]]></category>
		<category><![CDATA[ソフトウェア]]></category>
		<category><![CDATA[運用]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[ツール]]></category>

		<guid isPermaLink="false">http://it.snds.jp/?p=805</guid>
		<description><![CDATA[メモがてら。 Option Explicit On Error Resume Next '変数宣言 Dim oFS, oSh Dim sRecentPath, sRecentFilePath 'オブジェクト作成 Set  [...]

<h3 style="margin-top:5em;">関連記事:</h3>
(( 関連記事は特にありません ))]]></description>
			<content:encoded><![CDATA[<p>メモがてら。</p>
<pre>
Option Explicit
On Error Resume Next

'変数宣言
Dim oFS, oSh
Dim sRecentPath, sRecentFilePath

'オブジェクト作成
Set oFS = CreateObject("Scripting.FileSystemObject")
Set oSh = CreateObject("WScript.Shell")

'Recentフォルダパス指定
sRecentPath = oFS.BuildPath(_
 oSh.ExpandEnvironmentStrings("%AppData%"),_
 "Microsoft\Office\Recent")

If oFS.FolderExists(sRecentPath) Then
	'Recentファイルパス指定
	sRecentFilePath = oFS.BuildPath(sRecentPath, "*.lnk")

	'ファイル削除
	oFS.DeleteFile sRecentFilePath
Else
	Set oFS = Nothing
	Set oSh = Nothing
	WScript.Quit
End If

Set oFS = Nothing
Set oSh = Nothing
</pre>
<p>OfficeXP以降かつ、ポリシーで「最近使ったファイルを消去する」とかなんとかいうポリシーを有効にしていればこんなのいらないけど、Office2000 や Office97 を面倒見ないといけないこともあってガッと作った。後悔はしていない。</p>


<h3 style="margin-top:5em;">関連記事:</h3><p>(( 関連記事は特にありません ))</p>]]></content:encoded>
			<wfw:commentRss>http://it.snds.jp/software/805.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://it.snds.jp/software/805.html" />
	</item>
		<item>
		<title>【VBScript メモ】 所属するセキュリティ グループを取得する</title>
		<link>http://it.snds.jp/scripts/651.html</link>
		<comments>http://it.snds.jp/scripts/651.html#comments</comments>
		<pubDate>Tue, 16 Feb 2010 16:05:45 +0000</pubDate>
		<dc:creator>きく</dc:creator>
				<category><![CDATA[スクリプト]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://it.snds.jp/?p=651</guid>
		<description><![CDATA[自分自身が所属するActive Directory セキュリティ グループを取得する VBScript 関数のメモ。 戻り値は配列になります。 これだとプライマリ グループが拾えないが、その辺はMSの KB321360  [...]

<h3 style="margin-top:5em;">関連記事:</h3><ul><li><a href='http://it.snds.jp/software/805.html' rel='bookmark' title='Office の「最近使ったファイル」を削除する'>Office の「最近使ったファイル」を削除する</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>自分自身が所属するActive Directory セキュリティ グループを取得する VBScript 関数のメモ。</p>
<p>戻り値は配列になります。</p>
<p>これだとプライマリ グループが拾えないが、その辺はMSの <strong>KB321360</strong> <a href="http://support.microsoft.com/kb/321360" target="_blank">ネイティブな ADSI コンポーネントを使用してプライマリ グループを取得する方法</a> あたりでできそうなので後で実装する予定。</p>
<p>あと、多分これでは外部フォレスト (フォレスト信頼済み) のセキュリティ グループは拾えないと思うので、そこをどうするかが課題。だれか教えてください。(´・ω・`)</p>
<p><strong>2010/7/26 追記</strong></p>
<p>5か月越しの追記もどうかと思いますが、信頼済みの外部フォレストのセキュリティ グループは普通に拾えました。</p>
<pre>Function GetSecGroupName()
 Dim oADSI, oUser, oGroup
 Dim aGroups, aGroupNames
 Dim sGroup

 Set oADSI = CreateObject("ADSystemInfo")
 Set oUser = GetObject("LDAP://" &amp; oADSI.UserName)

 Select Case TypeName(oUser.MemberOf)
   Case "Variant()"
     aGroups = oUser.MemberOf
   Case "String"
     aGroups = Array(oUser.MemberOf)
   Case Else
     aGroups = Array(Empty)
 End Select

 ReDim aGroupNames(Ubound(aGroups))
 i = 0

 For Each sGroup In aGroups
   If Len(sGroup) &gt; 0 Then
     Set oGroup = GetObject("LDAP://" &amp; sGroup)
     aGroupNames(i) = UCase(oGroup.CN)
   End If
   i = i + 1
 Next

 GetSecGroupName = aGroupNames

 Set oADSI = Nothing
 Set oUser = Nothing
 Set oGroup = Nothing
End Function</pre>


<h3 style="margin-top:5em;">関連記事:</h3><ul><li><a href='http://it.snds.jp/software/805.html' rel='bookmark' title='Office の「最近使ったファイル」を削除する'>Office の「最近使ったファイル」を削除する</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://it.snds.jp/scripts/651.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://it.snds.jp/scripts/651.html" />
	</item>
	</channel>
</rss>

