Here is my current script, but as I said, it will take some tweaking since I need to detect for Terminal Server now as well. I borrowed someone else's login script to get the basic script in place including the graphical portion of the script.
Code:
$TITLE = SetTitle("Logging into Domain. Please wait...")
$CONSOLE = SetFocus ("Logging into Domain. Please wait...")
CLS
$section=1 ;Section 1
Color c+/n
Box (9,29,15,46,single)
Color r+/n
At (10,30) "Welcome to the,"
At (12,30) @domain
At (12,39) "domain"
At (14,30) @fullname
Sleep 4
Small
Color b+/n
Box (0,0,24,79,GRID) ; ''background grid''
Color b/n
Box (8,21,18,61,Å) ; ''shadow'' of the box
Color g+/n
Box (7,20,17,60,FULL)
SetTime "\\NRSDC02"
Color w+/n
At ( 9,25) "Userid : " ; display some text strings
At (10,25) "Full name : "
At (11,25) "Privilege : "
At (12,25) "Workstation : "
At (13,25) "Domain : "
At (14,25) "Logon Server : "
At (15,25) "Current Time : "
Color y+/n
At ( 9,40) @userid ; ...and some macro''s
At (10,40) @fullname
At (11,40) @priv
At (12,40) @wksta
At (13,40) @domain
At (14,40) @lserver
At (15,40) @time
Sleep 4
:set_vars
$section=$section+1 ; Section 2
;Use "*" /delete
;Windows XP declarations only
$f="\\nrsmain\SurveyDesign"
$g="\\nrsdc02\Public"
$H_9x=@HOMESHR
$H_XP=%HOMESHARE%
;$I_9x=@HOMESHR
;$I_XP=%HOMESHARE%
$n="\\nrsmain\db"
$s="\\nrsfs01\software"
$x="\\nrsdc02\marketing"
$y="\\nrsstage\surveyqueue"
$z="\\nrsstage\cardiff"
; Determines the OS type to either Server or Workstation
;$OSType = Checkversion()
If @INWIN = 1
$OSType = "NT"
Else
$OSType = "9x"
EndIf
CLS
At (12,30) "Mapping Global Drives"
Sleep 3
;delete drive mappings, excluding the I: drive
RemoveDrive("F:")
RemoveDrive("G:")
RemoveDrive("H:")
RemoveDrive("N:")
RemoveDrive("S:")
RemoveDrive("X:")
RemoveDrive("Y:")
;RemoveDrive("Z:")
;Map Global drives
MapDrive("G:",$g)
Select
Case ($OSType = "NT")
MapDrive("H:",$H_XP)
; MapDrive("I:",$I_XP)
Case ($OSType ="9x")
MapDrive("H:",$H_9x)
; MapDrive("I:",$I_9x)
EndSelect
MapDrive("X:",$x)
; Use P: $p
; Use U: $u+"$"
; Use Z: "\\djvkir1app2\photos"
:Domain_Admin
$section=$section+1 ; Section 3
If InGroup ("Domain Admins")
At (12,30) "Mapping Global Drives"
At (13,30) "Mapping Additional Drives"
Sleep 3
MapDrive("S:",$s)
EndIf
:Scanner
If InGroup ("Scanner")
At (12,30) "Mapping Global Drives"
At (13,30) "Mapping Additional Drives"
Sleep 3
MapDrive("Y:",$y)
MapDrive("Z:",$z)
EndIf
:SurveyDesign
If InGroup ("SurveyDesign")
At (12,30) "Mapping Global Drives"
At (13,30) "Mapping Additional Drives"
Sleep 3
MapDrive("F:",$f)
EndIf
:Paradox
If InGroup ("Paradox_N")
At (12,30) "Mapping Global Drives"
At (13,30) "Mapping Additional Drives"
Sleep 3
RemoveDrive("H:")
MapDrive("N:",$n)
EndIf
:END
Exit
; This function calls the appropriate OS calls to remove a drive maaping
Function RemoveDrive($DriveLetter)
Select
Case ($OSType = "NT")
Use $DriveLetter /delete
Case ($OSType ="9x")
Shell "Net Use " + $DriveLetter + " /delete"
CLS
EndSelect
EndFunction
; This function maps network drives using the appropriate OS calls
Function MapDrive($DriveLetter,$UNCpath)
Select
Case ($OSType = "NT")
Use $DriveLetter $UNCpath
Case ($OSType ="9x")
Shell NetUse($DriveLetter,$UNCpath)
CLS
EndSelect
EndFunction
; This function returns an win9x compatable net use statement
Function NetUse($DriveLetter,$UNCpath)
$NetUse = "Net Use " + $DriveLetter + " " + $UNCpath
EndFunction
; Check to see if what version of OS is running and
; Sets the type of computer to Workstation or Server.
Function CheckVersion()
If (@inwin = 1)
$NT_mode="yes"
Else
$NT_mode="no"
EndIf
$os_product=ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions","ProductType")
$os_dos=@dos
Select ; What type of computer are we running?
Case ($NT_mode = "yes") And ($os_product <> "WinNT") And ($os_dos = "5.1") ; - Windows XP Server
$Checkversion="Server"
Case ($NT_mode = "yes") And ($os_product = "WinNT") And ($os_dos = "5.1") ; - Windows XP Professional
$Checkversion="Workstation"
Case ($NT_mode = "yes") And ($os_product <> "WinNT") And ($os_dos = "5.0") ; - Windows 2000 Server -
$Checkversion="Server"
Case ($NT_mode = "yes") And ($os_product = "WinNT") And ($os_dos = "5.0") ; - Windows 2000 Pro -
$Checkversion="WORKSTATION"
Case @productType = "Windows NT Workstation"
$Checkversion = "WORKSTATION"
Case @productType = "Windows NT SERVER"
$Checkversion = "SERVER"
Case @productType = "Windows NT DOMAIN CONTROLLER"
$Checkversion = "SERVER"
Case @productType = "Windows 95"
$Checkversion = "WORKSTATION"
Case @productType = "Windows 98"
$Checkversion = "WORKSTATION"
Case @productType = "Windows ME"
$Checkversion = "WORKSTATION"
Case 1
$Checkversion = "Unknown"
EndSelect
EndFunction