Rename Scripting Problem

I've got this code working in IE but I can't get it working in DO. Can anyone see what I might be missing or why it's not running. Am I using some function that doesn't work in DO?

Rename TO="*"

@script vbscript
Option Explicit

dim DOpusRTPath
DOpusRTPath = "D:\ShellTools\DirectoryOpus\dopusrt.exe"

Function Rename_GetNewName ( strFileName, strFilePath, _
fIsFolder, strOldName, ByRef strNewName )
dim i
dim intPosition
dim strCheckField(1)
strCheckField(0) = ""
strCheckField(1) = "YouTube"
dim strNewName
dim strTempName

i = 0
strNewName = strFileName

do while i < UBound(strCheckField)
intPosition = InStr(strNewName, strCheckField(i))
select case intPosition
case 0
case 1
strNewName = mid(strNewName, intPosition + len(strCheckField(i)), len(strNewName))
case else
strTempName = left(strNewName, intPosition - 1)
strNewName = strTempName & mid(strNewName, intPosition + len(strcheckField(i)) + 1, len(strNewName))
end select
i = i + 1
strNewName = DatePart("yyyy",Now()) & DatePart("m",Now()) & DatePart("d",Now()) & " " & ltrim(strNewName)

End Function

strNewName is one of the function arguments; you shouldn't have "dim strNewName" in the function as well.

Thanks. I should've seen that but I'm blind in one eye and can't see out of the other.