The current directory in IIS appears to be the WWW-root all the time. I found that out when using the Cwd module. The $THIS_PATH could also be determinied by examining $0. Do this the way you like, either with a regexp, or with substr() and index().

This helped me out of much trouble in IIS, and makes the script platform-independant.