Hi Ken,

The code below is an example that could do the trick but it assumes some things that might not be true for you environment.

It assumes that the user ID starts with your first name or the first letter of your first name. It also assumes that the name of the home folder is the same as your user ID. It is basically a proof of concept and shows that it can be done.

Getting the first name from AD is also possible if (part of) your first name is not in the user ID. It depends a bit on how things are set up in your environment.

 Code:
Break on

;Get initial
$inital = SubStr(@USERID, 1, 1)

;Set path to home folder
$path = "\\fileserver\homeshare\User" + $initial + "\" + @USERID

;Set drive to use for home folder mapping
$drive = "H:"

;Delete the drive
Use $drive /delete /persistent

;Map correct drive
Use $drive $path


Edited by Mart (2011-12-21 08:08 AM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.