If I put a Robots.txt file into my root directory with instructions to block all bots, will it affect my subdomains (in subdirectories), too?
depends on what exactly did you write in the robots.txt file. If you block root then normally your whole website should be blocked from bots. BUT I had several experiences back then when I did the same thing but STILL, my website was indexed in google. I heard that this happened to a lot of people so I suggest that you don't rely on robots.txt . Also I don't know this for a fact but I think if you restrict root and you directly post a link to a subfolder of that root, google bot will still access the subfolder using that link and bypassing the root restriction.
if you have you sub, for example, at mysub.mydomain.com and its folder is in mydomain.com/mysub and your robots.txt file is in mydomain.com/ then it will have no effect on the mysub.mydomain.com because google will access it via that domain (not your main domain) so will never come accross the robots.txt file. Place the file in each sub domains root dir.
I have 2 different domains. One is in the root directory; the other is in a sub-directory. So, according to what you're saying, if I put the Robots.txt file into the root directory, the other domain in the sub-directory won't be affected. Is that correct?
It doesn't work on subdomains. All subdomains are considered a new site. By the way, you should name the file with "robots.txt" all low case, not "Robots.txt"