I have a string like this
\"C://Documents/TestUser/WWW/Help/Files/Move_Help.txt\"
and have to replace Move_Help.txt
Move_Help.txt
Str = "C://Documents/TestUser/WWW/Help/Files/Move_Help.txt"
ValueCrnt = "Help" ValueNew = "Job"
Pos = InStrRev(Str, ValueCrnt)
If Pos > 0 Then Str = Mid(Str, 1, Pos - 1) & Replace(Str, ValueCrnt, ValueNew, Pos) End If
Wscript.Echo Str