#20017 - 2002-04-16 07:09 PM
How can I do this with kixtart??
|
Lon M
Lurker
Registered: 2002-04-16
Posts: 4
|
I have a Citrix server and since the "Winnt" system folder is on the P: drive and I need different drive letters mapped (N: drive on Citrix)etc when logging onto Citrix vs logging onto a normal W2k workstation I used the following logon batch file to differentiate the two different envronments.
LOGON.BAT...........
if "%WINDIR%"=="P:\WINNT" GOTO WINFRAME if %OS%==Windows_NT goto WinNT if !%WINSTATIONNAME%==! goto Win95
:Winnt echo MTCLOGON WINNT SECTION rem net time \\Saturn /set /yes net use M: \\fire\MacShare /persistent:no net use S: \\fire\Data /persistent:no echo Dynamics dictionaries are now being updated, please wait...(WINNT SECTION) Copy \\earth\dyreport\*.* c:\eentrprs echo Dynamics dictionaries have now been updated. Thank you! Have a nice Day! :-) net time /set /y Goto End
:WinFrame echo MTCLOGON WINFRAME SECTION net use S: /d >NUL 2>NUL net use S: \\fire\Data /persistent:no >NUL 2>NUL net use M: \\fire\MacShare /persistent:no net use L: \\saturn\Apps /persistent:no net use O: \\Earth\Eenterprise\OLE /persistent:no If not Exist R:\DUsrData\%USERNAME% md R:\DUsrData\%USERNAME% SUBST N: R:\DUsrData\%USERNAME% echo Dynamics dictionaries are now being updated, please wait...(WINFRAME SECTION) Copy \\earth\dyreport\*.dic N:\
Any suggestions?
|
|
Top
|
|
|
|
#20018 - 2002-04-16 07:24 PM
Re: How can I do this with kixtart??
|
cmarti
Hey THIS is FUN
Registered: 2001-02-26
Posts: 297
Loc: Little Rock, AR
|
We added an environment variable to our terminal servers called %lanmode% = TSERVER, by doing this you can:
code:
IF '%LANMODE%'== 'TSERVER' goto TSERVER NET USE P: \\SERVERNAME\SHARE GOTO THEEND
:TSERVER NET USE N: \\SERVERNAME\SHARE
:THEEND
L8tr...
|
|
Top
|
|
|
|
#20020 - 2002-04-16 07:33 PM
Re: How can I do this with kixtart??
|
cmarti
Hey THIS is FUN
Registered: 2001-02-26
Posts: 297
Loc: Little Rock, AR
|
Stupid me...If I would've read your subject...
I wasn't sure about the subst line....but here's the rest....untested...
code:
SELECT CASE %WINDIR% = "P:\WINNT" GOTO WINFRAME CASE @INWIN = 1 GOTO WINNT CASE @INWIN <> 1 GOTO WIN95 CASE 1 GOTO THEEND ENDSELECT
:WINNT CLS ? "MTCLOGON WINNT SECTION" USE M: "\\FIRE\MACSHARE" USE S: "\\FIRE\DATA" ? "Dynamics dictionaries are now being updated, please wait...(WINNT SECTION)" SETTIME "\\SATURN" GOTO THEEND
:WINFRAME CLS ? "MTCLOGON WINFRAME SECTION" USE S: /DELETE USE S: "\\fire\Data" use M: "\\fire\MacShare" net use L: "\\saturn\Apps" net use O: "\\Earth\Eenterprise\OLE" ? "Dynamics dictionaries are now being updated, please wait...(WINFRAME SECTION)" SHELL "%COMSPEC% /C Copy \\earth\dyreport\*.dic N:\" :THEEND COOKIE1 EXIT
L8tr...
|
|
Top
|
|
|
|
#20021 - 2002-04-16 08:08 PM
Re: How can I do this with kixtart??
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
Lon,
Have you set up kixtart on your logon servers, yet? Everything you're doing here with .bat is possible in kixtart.
I like cmarti's basic idea.
Cmarti.. some questions on your code posted..
1. Why have your line say: CASE @INWIN <> 1 GOTO WIN95 instead of CASE @INWIN = 2 GOTO WIN95? What is the benefit of the first line over the second?
2. Why not use Kix's internal copy command instead of a shell to the windows command interpreter?
Like this: Copy "\\earth\dyreport\*.dic" "N:\"
3. Is the Cookie1 line necessary?
Brian
|
|
Top
|
|
|
|
#20022 - 2002-04-16 08:11 PM
Re: How can I do this with kixtart??
|
Lon M
Lurker
Registered: 2002-04-16
Posts: 4
|
Thank you Cmarti!
THe only thing left now is for me to figure out how to do the following in Kixtart from my above Winframe section.
If not Exist R:\DUsrData\%USERNAME% md R:\DUsrData\%USERNAME% SUBST N: R:\DUsrData\%USERNAME%
My R: drive (on Citrix) is my data drive. The above lines creates a user directory under R:\DUsrdata (if one does not exist) and then maps that User directory to be the N: drive. (hence the dictionaries copy to N: later in the script).
You helped me a ton already! If you do not have time to help me with this last part do not worry about it. I will just keep trying. Your the best!
|
|
Top
|
|
|
|
#20023 - 2002-04-16 08:16 PM
Re: How can I do this with kixtart??
|
Lon M
Lurker
Registered: 2002-04-16
Posts: 4
|
Thanks for the input Brian. Kixstart is on my logon servers right now but I am the only one using it so far. I am new to kixstart and have been working on this all day. I must have logged off and on 100 times today!
LOL
Thanks for your thoughts :-)
|
|
Top
|
|
|
|
#20024 - 2002-04-16 10:27 PM
Re: How can I do this with kixtart??
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
This should work:
MD "R:\DUsrData\" + @USERID ;creates user directory. USE N: /delete ;deletes current n: drive USE N: "\\RSERVER\RSHAREPATH\DUsrData\" + @USERID ; maps N drive.
The only difference is that kix can't do the same thing SUBST can. The N: drive would have to be mapped directly, or alternately you can just use:
SHELL "%comspec% /c subst n: r:\DUsrData\%USERNAME%"
Brian
|
|
Top
|
|
|
|
#20025 - 2002-04-16 11:41 PM
Re: How can I do this with kixtart??
|
Lon M
Lurker
Registered: 2002-04-16
Posts: 4
|
It works!
I want to thank you for your help! Attached is my live kix script. The part up to the addprinters commands are from a friend’s script. I am not sure that his code is necessary nor do I understand all that it does but it seems to work great on Citrix as well as a normal 2000K workstation. Thank you!
code:
CLS
;Identify Operating System Select Case @inwin=1 $kernel="WinNT" $Svcpack=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion","CSDVersion") $prodkey="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions" $type=ReadValue("$prodkey","ProductType") $Suite=ReadValue("$prodkey","ProductSuite") If Len($Suite)>0 $Suite=SubStr($Suite,1,InStr($Suite,"|")-1) Else $Suite="" EndIf Select Case @dos=5.0 $System="Win2k" Case @dos=4.0 $System="WinNT" EndSelect Select Case $type="LANMANNT" $DCRole=ReadValue("HKEY_LOCAL_MACHINE\Security\Policy\PolSrvRo","(No Name)") $flavor="$DCRole "+"$Suite "+"Domain Controller" Case $type="ServerNT" $flavor="$Suite "+"Member Server" Case $type="WinNT" $flavor="Workstation" EndSelect Case @inwin=2 $kernel="Win9x" $SubVer=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion","SubVersionNumber") Select Case @dos="4.90" $System="WinME" $flavor="A" Case @dos="4.10" $System="Win98" Select Case $subver=" SE " $flavor="SE" Case $subver=" A " $flavor="A" EndSelect Case @dos="4.0" $system="Win95" Select Case $subver=" C" $flavor="OSR2.5" Case $subver=" B" $flavor="OSR2" Case $subver="a" $flavor="A" EndSelect EndSelect EndSelect
Small Color g+/n Box (8,17,17,60,DOUBLE)
Color w+/n AT ( 9,20) "Userid : " AT (10,20) "Full name : " AT (12,20) "Privilege : " AT (13,20) "Workstation : " AT (14,20) "Kernel : " AT (15,20) "OS Type : " AT (16,20) "Logon Server : "
Color y+/n AT ( 9,35) @userid AT (10,35) @fullname AT (12,35) @priv AT (13,35) @wksta AT (14,35) $kernel AT (15,35) $System AT (16,35) @lserver Color w/n Sleep 3 CLS
SetConsole ("SHOW")
;Win 98 $Win9X=ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ProductOptions","ProductType") If @INWIN=2 AND ($System="WinME" OR $System="Win98" OR $System="Win95") ;DRIVE MAPPINGS FOR WIN 9X STATIONS Use L: "\\saturn\Apps" Use M: "\\fire\MacShare" Use S: "\\fire\Data" Use O: "\\Earth\Eenterprise\OLE" Exit EndIf
If InGroup ("TRIDENT\DOMAIN USERS") ;Start Mapping Drives & Printers AddPrinterConnection ("\\SUN\CAN3300_MAILROOM_5E") AddPrinterConnection ("\\SUN\CAN3300_5E_Mailroom_FAX") SETTIME "*" EndIf
If InGroup ("TRIDENT\4th Floor") AddPrinterConnection ("\\SUN\CANNON_4W_DESIGN") AddPrinterConnection ("\\SUN\HP4050TN_4E_DESIGN") AddPrinterConnection ("\\SUN\HP2100TN_4E_DESIGN") EndIf
If InGroup ("TRIDENT\5W") AddPrinterConnection ("\\SUN\CAN2200_5W_CUSTSRV") AddPrinterConnection ("\\SUN\HP4050_5W_ORDERS1") AddPrinterConnection ("\\SUN\HP5_5W_CUSTSRV") AddPrinterConnection ("\\SUN\CAN2200_5W_CUSTSRV_PCL6") EndIf
If InGroup ("TRIDENT\5E") AddPrinterConnection ("\\SUN\HP8100N_5E_SALES") AddPrinterConnection ("\\SUN\HP8100_5E_FINANCE") AddPrinterConnection ("\\SUN\HP5_5E_MAILROOM") AddPrinterConnection ("\\SUN\HP100_CREDIT_PHONEROOM") AddPrinterConnection ("\\SUN\HP1220C_5E_PHONEROOM") EndIf
If InGroup ("TRIDENT\SalesPostings") use V: "\\earth\salesposting" /persistent:no EndIf
SELECT CASE %WINDIR% = "P:\WINNT" GOTO WINFRAME CASE @INWIN = 1 GOTO WINNT CASE @INWIN <> 1 GOTO WIN95 CASE 1 GOTO THEEND ENDSELECT
:WINNT CLS ? "MTCLOGON WINNT SECTION" Use L: "\\saturn\Apps" /persistent:no Use M: "\\fire\MacShare" /persistent:no Use S: "\\fire\Data" /persistent:no Use O: "\\Earth\Eenterprise\OLE" /persistent:no ? "Dynamics dictionaries are now being updated, please wait...(WINNT SECTION)" SHELL "%COMSPEC% /C Copy \\earth\dyreport\*.dic c:\eentrprs" GOTO THEEND
:WINFRAME CLS ? "MTCLOGON WINFRAME SECTION" USE S: "\\fire\Data" /persistent:no use M: "\\fire\MacShare" /persistent:no use L: "\\saturn\Apps" /persistent:no use O: "\\Earth\Eenterprise\OLE" /persistent:no ? "Dynamics dictionaries are now being updated, please wait...(WINFRAME SECTION)" MD "R:\DUsrData\" + @USERID ;creates user directory. USE N: /delete ;deletes current n: drive SHELL "%comspec% /c subst n: r:\DUsrData\%USERNAME%" SHELL "%COMSPEC% /C Copy \\earth\dyreport\*.dic N:\" :THEEND EXIT
[ 16 April 2002, 23:44: Message edited by: Lon M ]
|
|
Top
|
|
|
|
#20026 - 2002-04-17 03:49 PM
Re: How can I do this with kixtart??
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
It looks nice, Lon!
Looks like you had a lot of fun figuring out what system a user has! :-)
Brian
|
|
Top
|
|
|
|
#20027 - 2002-04-17 10:35 PM
Re: How can I do this with kixtart??
|
cmarti
Hey THIS is FUN
Registered: 2001-02-26
Posts: 297
Loc: Little Rock, AR
|
Brian,
There is no advantage to CASE @INWIN <> 1 GOTO WIN95 instead of CASE @INWIN = 2 GOTO WIN95
That's the way I've always done it..insanity would be a good reason I guess..
|
|
Top
|
|
|
|
#20028 - 2002-04-17 10:54 PM
Re: How can I do this with kixtart??
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
Ok.. just checking. I don't see the point of having a
CASE 1
if you've got both a
CASE @INWIN = 1
and
CASE @INWIN <> 1
What other possibility is there? lol
Brian
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|