|
|
|||||||
Hi all, I have done this a several of times on several networks, but it doesn't work on a new network i'm working on. I have created a batch file and put in the logon script field in the users in the AD. But when i try to run it i get an error message that says "couldn't find/open logon.kix" the code in the batch is: Code: %0\..\kix32.exe \\[server name]\netlogon\logon.kix whats wrong here? |
||||||||
|
|
|||||||
How about: Code: %LOGONSERVER%\NETLOGON\kix32.exe %LOGONSERVER%\NETLOGON\logon.kix |
||||||||
|
|
|||||||
Without the double "\\" before the %logonserver% ? I'll try it and post again for success or failure |
||||||||
|
|
|||||||
Originally Posted By: ddady Without the double "\\" before the %logonserver% ? .... Yes. %logonserver% has \\servername as its value so the extra \\ is not needed. |
||||||||
|
|
|||||||
Using a specific server name in the path is not recommended, because it places all the load and responsibility on that server. Using %LOGONSERVER% in that form is questionable, as it isn't in my environment set to confirm the slashes are present (although the LOGON environment is different from the RUNNING environment). See this page for standard environment variable definitions. Unfortunately, it doesn't clarify the format. The proper method is to use Code: \\DOMAIN\NETLOGON\kix32.exe \\DOMAIN\NETLOGON\logon.kix Glenn |
||||||||
|
|
|||||||
I use the following in my bat file so that it can access the kix scripts @ECHO OFF %0\..\kix32 %0\..\default.kix Hope it helps |
||||||||
|
|
|||||||
Originally Posted By: Glenn Barnas Using a specific server name in the path is not recommended, because it places all the load and responsibility on that server. Using %LOGONSERVER% in that form is questionable, as it isn't in my environment set to confirm the slashes are present (although the LOGON environment is different from the RUNNING environment). See this page for standard environment variable definitions. Unfortunately, it doesn't clarify the format. The proper method is to use Code: \\DOMAIN\NETLOGON\kix32.exe \\DOMAIN\NETLOGON\logon.kix Glenn Then again, DFS on 2000 Domains is less stable then using Sharenames on servers, and is prone to errors in the DFS system, DNS system et all. besides that %LOGONSERVER% is the server that answered the quickest. So load balancing is always in place. %LOGONSERVER% will always point to an Active server so %LOGONSERVER% is best practice in my opinion. Anyway this is just discussing Proper use. Has nothing to do with the original problem ;-) |
||||||||
|
|
|||||||
Originally Posted By: NaasMarais I use the following in my bat file so that it can access the kix scripts @ECHO OFF %0\..\kix32 %0\..\default.kix Hope it helps Well, this method solved the problem. Thanks NaasMarais :-) And ofcourse thanks to Glen and apronk |
||||||||
|
|
|||||||
Great that it solved the problem but it is very very very old school (NT4). The options Arend and Glenn posted should both also do the trick and are way more up to date. My personal preference (and what I tell people when they ask) would be wath Glenn suggested. |
||||||||
|
|
|||||||
Frankly i prefer to use the %SERVERLOGON% or the DOMAIN methods, but unfortunately they dont workm in my case. I'm using a SERVER 2003 with XP PRO. Like i said in the begining, i have tried it with the server name as i used it before in other networks and it worked, but from some reason over here now it doesn't. If anyone knows why and how to fix it, i will be more than glad to do it. |
||||||||
|
|
|||||||
%SERVERLOGON% can not work, because the name of the variable is %LOGONSERVER%. Now I changed my script and I call it this way: \\%USERDOMAIN%\NETLOGON\wkix32.exe \\%USERDOMAIN%\NETLOGON\logon.kix It works fine, but I read, that if wkix is used, it should be started this way: start /w /b \\%USERDOMAIN%\NETLOGON\wkix32.exe \\%USERDOMAIN%\NETLOGON\logon.kix What do you think about that and what should be used? wkix32 or kix32? |
||||||||
|
|
|||||||
wkix32.exe is functionally identical to kix32.exe except that it does not create a default console aka "DOS box" when it launches. wkix32 is used for silent scripting when you don't want an ugly empty black window to pop up. wkix32 may still create a console under certain conditions. The /B switch tells CMD.EXE not to start a new console, so serves a similar purpose. The /W is (I assume) a synonym for /WAIT, and it tells CMD.EXE to wait for the command to complete. It's useful for commands that detach from the process that started them. In this case if it is working as you expect then you don't need "START /W /B" |
||||||||
|
|
|||||||
Ok, thank you. I read in the Docu that wkix don't create a box, but in my evironment it creates a box, so I never understood the differnce between these two. Do you know, in which conditions it still creates a box? |
||||||||
|
|
|||||||
If you create screen output then a command window will pop up. |
||||||||
|
|
|||||||
Originally Posted By: Mart If you create screen output then a command window will pop up. What Mart said. Look for unhandled values returned from functions (zeros and ones on the screen) |
||||||||
|
|
|||||||
here is my cmd file : Code: @echo off setlocal set scriptdir=%~dp0 set scriptname=%~n0 "%scriptdir%kix32.exe" "%scripdir%%scriptname%.kix endlocal scriptdir contains the full path of the .cmd file scriptname constains the cmd file without extension. So in the directory, i have logon.cmd, logon.kix and kix32.exe If i have to test a new version, i can copy the files anywhere. All path are relative to the path of the logon.cmd file This has been working since NT4 |