title: How to search a folder name at a particular location, with a wildcard character and store in a variable?
body: <p>This is the script I have written and I have mentioned the issue I am facing below.</p>
  
  <pre><code>Option Explicit
  Dim FSO, WSH, RunDefaultProfile
  Dim PF, UPF
  
  Set FSO = CreateObject("Scripting.FileSystemObject")
  Set WSH = CreateObject("Wscript.Shell")
  
  UPF = Wsh.ExpandEnvironmentStrings("%userprofile%")
  PF = Wsh.ExpandEnvironmentStrings("%ProgramFiles(x86)%")
  
  RunDefaultProfile = """" &amp; PF &amp; "\Mozilla Firefox\firefox.exe" &amp; """" &amp; _
                      " -CreateProfile default"
  
  ' Create the Default profile if it not exists
  If NOT FSO.FolderExists (UPF &amp; "\AppData\Roaming\Mozilla\Firefox\Profiles\c4ssju9t.default") Then
    WSH.Run RunDefaultProfile
  End if
  </code></pre>
  
  <p>Now the challenge I am facing is, Firefox creates a random <code>.default</code> folder on each machine and I can't use my <code>If NOT FSO.FolderExists</code> condition. Also I want store the <code>.default</code> folder name if already exists. I will use that to run other commands and expand my script.</p>