Question: I have installed VisualSVN Server on Windows XP. (Authentication method - Basic Windows authentication). I edited the `pre-lock.cmd` script and put a comment line, `REM do nothing`. 

Next I tried to get a lock on a file. Everything works great until this point!

Then I try to release the lock and get the following error `Server sent unexpected return value (400 Bad Request) in response to UNLOCK`. 

Please note I do not have any pre/post unlock scripts in place. I am using the TortoiseSVN client. I have tried the lock/unlock routine without the pre-lock hook and it works fine.

Any insight on why this must be happening will be helpful.

Answer: 
Starting with Subversion 1.6 the output of a pre-lock script is important. a .bat file echo's by default, so every command is sent to the output which will cause problems.

Have as the first line
@echo off

and things should go much better
You have to put a line like

```
exit 0

```

in your pre-lock.bat script (not sure if \*.cmd scripts work, but \*.bat files do).

Also the "bad request" error could be because a firewall/router/virus scanner doesn't allow (or know) DAV requests.