Welcome to Korg!

You are using Macros in strings, which could impact what's happening. Better method is to use something like:
 Code:
$ResPath = "\\" + @Comment + "\My_Drive"
"Mapping V: to " $ResPath ?
Use $ResPath
The "mapping to.." is just for debugging to make sure you define the variable correctly. Also, you aren't testing to make sure that "@Comment" is actually set, which could cause the mapping to fail. I assume that you're setting the user's comment in their AD Profile to the name of the server you want to connect to. Might work, but will be difficult to maintain.

There's no closing EndIf, but I assume you just didn't copy/paste it into your example.

If you have limited scripting skills, you might want to look at the Kix-based login script on my web site. Free for small businesses and inexpensive for larger environments, it will allow mapping by AD Site, subnet, computer or user OU. Similar to what you're doing with a variable in the mapping path, our script supports macros to dynamically replace the server name, share name, or any/all of the resource path based on 13 different types of macros. With no coding, you can have a basic script running in an hour of reading the manual. It's been deployed and proven at many large, multi-national sites over the past 15 years.

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