I have encountered an issue running a batch-file as administrator on Vista/Windows 7. Running a script with evaluated privileges, the system executes it under the System32 directory. It caused a wrong interpretation of relative paths in my script. Fortunately, there is an elegant solution to fix this issue.

In order to return to a directory the batch-file was run, it is enough to include the following command at the top of your script:

cd %~dp0

"%~dp0" contains a local path of executing file. The "Using batch parameters" article explains how it works.