Hey CitrixMan,

That code works perfectly. I tried it on three different servers with different server numbers (some had 4 and some had 5) and the drives mapped correctly. Thanks, much appreciated.

What would happen if the logonserver doesn't have any numeric values i.e. OFFDC01 rather than 7777DC01, will the script just fail or continue to process?

Thanks heaps everyone for your help...