How do I access the database from a stand-alone PHP script?
Check the first line (where you have ..testdrupal\');

The \ before the ' is escaping the ' so it's as if it's not there (sorry, it's tricky to explain without my morning coffee).

With the character escaped, the line is being read as follows:

chdir('C:\xampp\htdocs\testdrupal'./includes/bootstrap.inc');

Which is where your error is most likely coming from.

Try changing the first line to the following:

chdir('C:\xampp\htdocs\testdrupal\\');


The extra \ means that you are escaping the following character so the line will be read the way you want it to be.

There's a quick explanation of escape characters here.