You need .htaccess on xampp for Windows.
Open a command line. Write there
C:\xampp\apache\bin>htpasswd -c -m -b c:\xampp\htdocs\.htpasswd username password
Create a .htaccess file and fill in it
AuthType Basic AuthName "Access for restricted area" AuthUserFile c:/xampp/htdocs/.htpasswd require user username
Copy the .htaccess file to the directory you need the secured area.
Difference to your settings are: The path to the apache bin folder or htdocs folder on your xampp installation could be different. Change the above mentioned paths to your need.
The words “username” and “password” are only synonyms for real terms.