title: renames file on a folder based on webpage
body: <p>I dont know whether this is proper question or not but I am learning. I have a webpage which has some buttons on it
  like  <strong>japan,tokyo,india,UK, USA</strong></p>
  
  <p>and a folder which has images on it</p>
  
  <pre><code>YK08HJX_SYPTE_20140403170541594.jpg
  YK08HJX_SYPTE_20140403170542194.jpg
  1YK0BHJX_SYPTE1-PC_20140403170000670.jpg
  </code></pre>
  
  <p>. when user click s on any button on webpage  it should change the sypte1-PC or SYPTE to that button text.</p>
  
  <pre><code>YK08HJX_japan_20140403170541594.jpg
  YK08HJX_INDIA_20140403170542194.jpg
  1YK0BHJX_UK_20140403170000670.jpg.
  </code></pre>
  
  <p>any help would be appreciated.</p>
  
  <p>this was my code: but dont how to interact directly with webpage on button click or href. text.</p>
  
  <p>Listing A: RenameFiles.vbs</p>
  
  <pre><code>Dim WshShell, FileManagement, BrowseDialogBox, SelectedFolder, OldString, NewString, FullPath, TheFolder, FileList
  Dim File, ThisFile, TheString, AlreadyRenamed, TempName, FlagName, Success, FindFlag, NewName, Dummy
  Set WshShell = WScript.CreateObject("WScript.Shell")
  Set FileManagement = WScript.CreateObject ("Scripting.FileSystemObject")
  Set BrowseDialogBox = WScript.CreateObject("Shell.Application")
  Set SelectedFolder = BrowseDialogBox.BrowseForFolder(0, "Select the folder containing the files you want to rename.", &amp;H0001)
  If InStr(1, TypeName(SelectedFolder), "Folder") = 0 Then
      WScript.Quit
  Else
      OldString = InputBox("Enter the characters in the filename that you want to replace","Rename Files")
      If OldString = "" Then WScript.Quit
      NewString = InputBox("Enter the characters that you want to replace them with","Rename Files")
      ‘If NewString = "" Then WScript.Quit
  End If
  FullPath = SelectedFolder.ParentFolder.ParseName(SelectedFolder.Title).Path
  Set TheFolder = FileManagement.GetFolder(FullPath)
  Set FileList = TheFolder.Files
  Success = 0
  For Each File In FileList
      ThisFile = File.Name
      TheString = InStr(ThisFile, OldString)
      AlreadyRenamed = InStr(ThisFile, "%")
      If (TheString &lt;&gt; 0) And (AlreadyRenamed = 0) Then
          Success = 1
          TempName = Replace(ThisFile, OldString, NewString)
          FlagName = "%" + TempName
          File.Name = FlagName
      End If
  Next
  For Each File In FileList
      ThisFile = File.Name
      FindFlag = InStr(ThisFile, "%")
      If FindFlag &lt;&gt; 0 Then
          NewName = Replace(ThisFile, "%", "")
          File.Name = NewName
      End If
  Next
  If Success = 1 Then
      Dummy = WshShell.Popup ("Rename Files operation complete!",5,"Rename Files",64)
  Else
      Dummy = WshShell.Popup ("Rename Files operation failed! Please repeat the operation.",0,"Rename Files",16)
  End If
  WScript.Quit
  </code></pre>