#24776 - 2002-07-11 05:48 AM
Calling DoctorS in the House
|
seandragon
Fresh Scripter
Registered: 2002-07-09
Posts: 17
|
I'm using KiXtart 4.10ver. And I'm trying to implement in the environment, 2K Server and XP client. I calling the KiXtart script through a batch file and so far I haven't been successful. This how I would like to happen, a simple drive mapping and group membership a windows screen and some greetings. Please see below for more info. ThanX Fidel
Batch
@Echo off If exist c:\windows\system32\kix32.exe goto drive %0\..\kix32.exe \\mmnetad1\netlogon\script.kix goto end :drive c:\windows\system32\kix32.exe \\sbserver\netlogon\testras.kix :end @echo off
KiX
?" Hello "+ @FULLNAME " ?" Today is "+ @DAY " "+ @DATE " " " The Time is "+ @TIME ?"You Are Logging In To The "+ @DOMAIN " Domain " ?"Your Login Server Is "+ @LSERVER ? "Synchronizing your system's clock" ;synchronize with time server SETTIME "\\server" IF @error = 0 ? "System clock synchronized" ELSE MESSAGEBOX ("Cannot synchronize the system clock. Please inform your administrator.", XYZ Login Script", 0) ;ENDIF ? "Mapping network drives..." ;MAP Drives by Group Membership ;Map Domain Pcsupport T: drive IF INGROUP ("Domain pcsupport") = 1 USE T: /delete /persistent USE T: "\\mmnetad1\tools" ? "PcSupport Drive Mapped ENDIF ;Map common drives for Domain Users IF INGROUP ("DOMAIN Users") = 1 USE g: /delete /persistent Use g: "\\mmnetad1\home\@userid" ENDIF ? "Login Script Complete" EXIT
|
|
Top
|
|
|
|
#24778 - 2002-07-11 06:17 AM
Re: Calling DoctorS in the House
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
We have take at your script. Some remarks: - scripts wasn't correct. missing quotations and ENDIF - your batch file doesn't verify kix32 on your c:\winnt directory
Your batch file may look like:
code:
@echo off if exist c:\windows\system32\kix32.exe goto client if exist c:\winnt\system32\kix32.exe goto client \\mmnetad1\netlogon\kix32.exe \\mmnetad1\netlogon\script.kix goto end :client kix32.exe \\sbserver\netlogon\testras.kix :end @echo off
Your script may look like
code:
? " Hello "+@fullname ? " Today is "+@day+" "+@date+" The Time is "+@time ? ? " You Are Logging In To The "+@domain+" Domain" ? " Your Login Server Is "+@lserver ? ? " Synchronizing your system's clock" ;synchronize with time server SETTIME "\\server" IF (@error = 0) ? " System clock synchronized" ELSE $null=MessageBox("Cannot synchronize the system clock."+@crlf+@crlf+"Please inform your administrator.","XYZ Login Script",0) ENDIF ; ; MAP Drives by Group Membership ; ? " Mapping network drives..." ; ; - Map Domain Pcsupport T: drive IF InGroup("Domain pcsupport") <> 0 USE t: /delete /persistent USE t: "\\mmnetad1\tools" ? " PcSupport Drive Mapped" ENDIF ; - Map common drives for Domain Users IF InGroup("DOMAIN Users") <> 0 USE g: /delete /persistent USE g: "\\mmnetad1\home\@userid" ENDIF ? " Login Script Complete" EXIT
|
|
Top
|
|
|
|
#24779 - 2002-07-11 06:19 AM
Re: Calling DoctorS in the House
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear Lonkero,
You beat me. Improvements to the batch file
code:
@echo off if exist %windir%\system32\kix32.exe goto client \\mmnetad1\netlogon\kix32.exe \\mmnetad1\netlogon\script.kix goto end :client %windir%\system32\kix32.exe \\sbserver\netlogon\testras.kix :end @echo off
greetings.
|
|
Top
|
|
|
|
#24781 - 2002-07-11 07:58 AM
Re: Calling DoctorS in the House
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Made some changes to MCA's version of the batch script..
This will work from any domain controller that gets the login script files replicated to it..
code:
@echo off if exist c:\windows\system32\kix32.exe goto client if exist c:\winnt\system32\kix32.exe goto client %logonserver%\netlogon\kix32.exe %logonserver%\netlogon\script.kix goto end :client kix32.exe %logonserver%\netlogon\testras.kix :end
Replaced \\mmnetad1 and \\sbserver with %logonserver%.. Removed the second @echo off.
Regards,
Kent
|
|
Top
|
|
|
|
#24783 - 2002-07-12 12:52 AM
Re: Calling DoctorS in the House
|
seandragon
Fresh Scripter
Registered: 2002-07-09
Posts: 17
|
Guys, thanks for all your help. I just want to ask if this would allow user to see a welcome screen after login. Thankx...
|
|
Top
|
|
|
|
#24787 - 2002-07-11 10:23 PM
Re: Calling DoctorS in the House
|
seandragon
Fresh Scripter
Registered: 2002-07-09
Posts: 17
|
Thanx to everybody and to Jens!
Server Time Sync was an issue but with your advice its working....
Is there anyway that I can see the "cmd windows automatically"? I have to catch the dos window in order for me to see the greetings. ThanX Fidel
|
|
Top
|
|
|
|
#24788 - 2002-07-11 10:25 PM
Re: Calling DoctorS in the House
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Fidel,
If you want to slow things down to see what is going on..
Try the debug mode:
kix32 yourscript.kix /d
HTH,
Kent
|
|
Top
|
|
|
|
#24791 - 2002-07-11 10:41 PM
Re: Calling DoctorS in the House
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11628
Loc: CA
|
seandragon,
You could use a timer to slow down the process.
Kent, MCA:
A better approach for the batch file would be:
code:
@echo off if exist %windir%\system32\kix32.exe goto client kix32.exe script.kix goto end :client %windir%\system32\kix32.exe %logonserver%\netlogon\testras.kix :end
On my system 2000 is installed on the F: drive. This batch would also work if the client PATH was invalid or screwed up, just calling by path might fail on some clients. NT/2000/XP (according to MS) already know where they are in the environment during logon, so they don't need to be told the path to the logon server either. So would work on all logon servers as well.
|
|
Top
|
|
|
|
#24795 - 2002-07-11 11:43 PM
Re: Calling DoctorS in the House
|
seandragon
Fresh Scripter
Registered: 2002-07-09
Posts: 17
|
Lonkero,
How do you go about that? I apologize for my lock of knowledge in this.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 837 anonymous users online.
|
|
|