The main problem is the space between (% dir1% * .txt)
It could be
@ECHO off
title Test
set "dir1=C:\Users\Family\Desktop\Example"
:Start
cls
echo 1. test loop
echo 2. Quit
set /p choice=I choose (1,2):
if %choice%==1 goto test
if %choice%==2 exit
:test
cls
echo running loop test
FOR %%X in ("%dir1%\*.txt") DO echo %%~dpnX
echo Done
pause
Quotation marks are designed to prevent problems with spaces or other special characters in the path.
EDIT:
%%~dpnX designed to expand the file name %%Xto
d= drive (C :)
p= path (\ Users \ Family \ Desktop \ Example)
n= file_name (test1) (without extension)
f= fully qualified file name (C: \ Users \ Family \ Desktop \ Example \ test1.txt).
Possible modifiers are described here FOR /?