It's not all that hard, here's a 5 line solution:
set "x=<script data-cfasync="false" type="text/javascript"> fid="RandonString"; v_width=620; v_height=490;</script>"
set "x=%x:*fid=%"
set "x=%x:";="&rem %
set x=%x:~2%
echo %x%
An explanation of what is going on.
You have to deal with 5 special characters, the <, >, =, " in your string, and the & character used to trim trailing data.
Lines 1-3: <> are both redirection characters, so to deal with them, it's required that the whole variable be surrounded by doublequotes ("). BUT you don't want the double quotes to be added to the variable itself.
Line 1 By putting the first quote before the variable to be set ( "x=), and the second one after the data to be set (<script data-cfasync="false" type="text/javascript"> fid="RandonString"; v_width=620; v_height=490;</script>" ), the command SET recognises that the quotes are not to be included in the variable. Thus variable data with special characters can be set without errors. (Putting the quotes inside the variable data will work too, but adds 2 special characters to the variable data and makes dealing with other search & replace commands more difficult.)
Line 2 The next step is to remove everything up to and including fid, *fid matches everything up to fid, the =% replaces it with nothing.
Line 3 The next step is to to remove everything after ";, this requires a little hack. The command processor can be tricked into doing this by adding ="&rem % to the search and replace. The '=' tells the command processor to replace ;" with the following characters, but the next character is ", which makes the preceding set command a quoted command, and means that the special & character is not quoted, leaving it available to be interpreted. This essentially puts everything after the & on a separate line, and so the search and replace command replaces "; with nothing. The REM statement is there to make sure the data that comes after the matched "; is not interpreted as a command and also means that any redirection characters will be ignored.
So what the command processor sees is:
set x=="RandonString
rem "; v_width=620; v_height=490;</script>
Which sets x to ="RandonString
Line 4 Now we have a problem since %x% begins with =", and both = and " are special characters, with = being especially hard to match. But, luckily we know that the string now starts with =", so the solution is simple. We simply skip the first two characters by telling the command processor to start with the 2nd character (character 0 currently = =, character 1 currently = ", so character 2 = R). Therefore, since Line 2 removed everything (including any redirection characters) up to and including fid, and Line 3 removed everything including "; to the end of the string (including any redirection characters),
%x:~2% = RandonString. With all the redirection characters removed, the variable does not need to be quoted at all.
Line 5 Just echo's the variable x.