In order to block all bots from accessing your site, you should create a robots.txt file with the following content:
User-agent: *
Disallow: /
To block all bots from accessing a specific folder, you should create a robots.txt file with the following content:
User-agent: *
Disallow: /folder/
Please note that blocking all bots will get your site deindexed from search engines.