Not likely a script problem..

Make sure that your have a Computer GPO defined that enables "Always wait for the network at computer startup and logon". This has been discussed here several times, along with the "Run logon scripts synchronously", which prevents the dsesktop from displaying before the script completes. Without the former setting, the login process will start before all network services are ready.

I include these policies at every client site and never have these kind of issues once they are in place.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D