0
vbスクリプトでフォルダ名を読み取り、特定の単語を探すにはどうすればよいですか?VBスクリプトでフォルダ名内の単語を探します
EG:= 1234abc_Complete
フォルダ名は、どのように私は、変数としてテキストが完了し、店で入手できますか?
ありがとうございました!
vbスクリプトでフォルダ名を読み取り、特定の単語を探すにはどうすればよいですか?VBスクリプトでフォルダ名内の単語を探します
EG:= 1234abc_Complete
フォルダ名は、どのように私は、変数としてテキストが完了し、店で入手できますか?
ありがとうございました!
次のコードは、必要に応じて行う必要があります。
Option Explicit
' create a FileSystemObject
Dim oFso : Set oFso = CreateObject("Scripting.FileSystemObject")
' Set a reference to the folder which contains the folders you want to look through
Dim oFolder : Set oFolder = oFso.GetFolder("PathToFolderInHere")
Dim oSubFolder, myVar
' loop through each subfolder
For Each oSubFolder in oFolder.SubFolders
' If the oSubFolder contains the word complete then set myVar and exit the loop
If InStr(1, oSubFolder.Name, "complete", vbTextCompare) > 0 Then
myVar = oSubFolder.Name
Exit For
End If
Next
' do whatever with myVar (the folder name you wanted in the variable).