When Command Extensions are enabled (Windows XP and newer, roughly), you can use the syntax %~nF (where F is the variable and ~n is the request for its name) to only get the filename.
FOR /R C:Directory %F in (*.*) do echo %~nF
should echo only the filenames.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…