And on the kix side here is what I have in a drive mapping .kix called by the main kix script
 Code:
; 
; Uses GLOBAL Variables:  $PCDomain

DIM $TWHT, $CLRH, $GenShare, $UserShellFolders, $x, $IsFacServ, $Serv, $TWHT2

$TWHT             = "\\twhtshr04"
$TWHT2            = "\\twhtshr02"
$CLRH             = "\\CLRHSVR03"
$GenShare         = SUBSTR(@userid,1,9)
$UserShellFolders = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"



     
; ************************************************
; Home-drive mapping
   IF EXIST ("$TWHT\"+@userid+"$")
      MapDrive("H:","$TWHT\"+@userid+"$")

      IF NOT ReadValue($UserShellFolders, "Personal") = "H:\"
         $x = WriteValue($UserShellFolders, "Personal", "H:\", "REG_SZ" )
      ENDIF

      IF NOT EXIST ("H:\Favorites")
         MD "H:\Favorites"
      ENDIF
      IF NOT EXIST ("H:\Outlook")
         MD "H:\Outlook"
      ENDIF
;      IF NOT EXIST ("C:\Documents and Settings\@userid\Favorites.txt")
;         COPY "C:\Documents and Settings\@userid\Favorites\" "H:\Favorites\" /s
;      ENDIF
      IF NOT ReadValue($UserShellFolders, "Favorites") = "H:\Favorites"
         $x = WriteValue($UserShellFolders, "Favorites", "H:\Favorites", "REG_SZ" )
      ENDIF
   ENDIF



? " "

RETURN



; *************************
; *       MAPDRIVE        *
; *************************
Function MapDrive($Drive, $Path)
   Use $Drive /del
   Use $Drive $Path

   if @ERROR = 0
      ? "   Drive " + $Drive + " mapped to " + $Path
   else
      Color r+/n
      ? "   Error Mapping Drive " + $Drive + " to " + $Path + " !!"
      ? "Error: " + @Error + " - " + @SError
      Color w/n
   endif
EndFunction
RETURN


And you can see the $x up there and that is defined on my main .kix
 Code:
; *************************
; *       ISFACSERV       *
; *************************
Function IsFacServ($Serv)
   Dim $x
   $x = GetObject("LDAP://CN=" + $Serv + ", OU=s*****, OU=*****, DC=*****, DC=*****, DC=*****")
   If @Error = 0
      $IsFacServ = 1
   Else
      $IsFacServ = 0
   Endif
EndFunction
RETURN

Yes I put the ******** there \:\)

I have matched the DIR security permissions but I have been unable to replicate the security permission on the 2 utilities dir called
S-1-5-21-2142779916-377378312-1295600288-512

Ok on the server this script works on the 2 utilities DIR says access denied but I coped the DIR to get all the contents but now I can’t get it to go back to access is denied as I think that could be a reason this is not working.

If there is an easier way to do this I am all ears, I just need a way to map user home shares on the fly and connect/reconnect on logon.

Thank You


Edited by FullBoost (2007-05-25 05:59 PM)