VBSの質問です
以前コチラで行った質問の続きです
以下のプログラムを取得フォルダの2つ上のフォルダからリンクを取得してくるようにしていただきたいのですがどうすればいいでしょうか?よろしくお願いします。
例 a>a>a なら <img src="a/a/a/" になるようにです
Dim file ' 対象ファイル
Dim file2 ' 書き込み先ファイル
Dim re ' 正規表現オブジェクト
Dim strOldText ' 置換前テキスト
Dim strNewText ' 置換後テキスト
Dim strFind ' 検索文字列
Dim strReplace ' 置換文字列
Set file = fso.OpenTextFile( strInputFileName )
strOldText = file.ReadAll
Set re = New RegExp
re.Multiline = True
re.Global = True
' 置換1
strFind = "<img src = """
strReplace = "<img src=""" & strTargetName & "/"
re.Pattern = strFind
strNewText = re.Replace(strOldText, strReplace)
' 置換2
strFind = "<td align=""center"" valign=""top"">"
strReplace = "<td>" & strTargetName & "</td><td>"
re.Pattern = strFind
strNewText = re.Replace(strNewText, strReplace)
file.Close
Set file2 = fso.CreateTextFile( strOutputFileName )
file2.WriteLine (strNewText)
file2.Close
End Sub