First the batch file needs to be called "search.bat" as you are typing Search.
The other thing is that the search.bat file should be in the same folder from where you are trying to run it. Other option would be the have the path where the search.bat resides added the environment variable "PATH"
One change to the code is needs as it seems that you are passing two parameters. One the director and the other the characters of the file
Save the code below Search.bat in your root c:\
Then type: cd /d c:\
Then run search file,
search "c:\windows" "sys"
if %str%==\ GOTO MoveOn
dir /a-d %searchFor%