Your syntax is wrong. Here is a possible solution (you will need delayed expansion):
for %A IN (*) do @set file=%A && if !file!==!file:ntdll=! (@del /F /A !file!)
Enable delayed expansion in cmd with cmd /v:on
. You are forced to use it as you are inside a code block.
This simple command searches for all files in the current working directory, assign each in a variable and checks if they have the string ntdll
inside them. If not, they delete them.
For better understanding commands mentioned above, open a new cmd and type:
Some interesting references for further reading