#166967 - 2006-09-07 12:46 PM
Re: Mapping network drives
|
ddady
Getting the hang of it
Registered: 2006-09-03
Posts: 98
|
Thanx Richard and Witto
I will try it and Win98 doesn't work with deep mapping, i have tried it.
I have one question, i didn't quite understood this code, written by Witto:
Dim $SO $SO = SetOption("Explicit","On") $SO = SetOption("NoMacrosInStrings","On") $SO = SetOption("NoVarsInStrings","On") $SO = SetOption("WrapAtEOL","On")
$SO = DelTree("HKEY_CURRENT_USER\Software\KiXtart\TokenCache")
I mean, why do it this way ----> $SO = SetOption("Explicit","On") when only writing this way ----> SetOption("Explicit","On") will do the trick??
|
|
Top
|
|
|
|
#166969 - 2006-09-07 01:40 PM
Re: Mapping network drives
|
ddady
Getting the hang of it
Registered: 2006-09-03
Posts: 98
|
Ok, now i undrstand why i see it on the screen ;-)
Another question [if i may], right now everytime i want to see the changes or the new code i have configured in the login.kix file i have to logoff and login a computer. Is there a faster way to run the script and to see the results?
as for now my .bat file looks like this : @echo off %0\..\kix32 %0\..\login.kix
what if i want to run test.kix? i have tried making a new .bat file called test.bat and configuered it like this %0\..\kix32 %0\..\test.kix [and ofcourse made a kix file called test]
But i'm getting error message.....
|
|
Top
|
|
|
|
#166970 - 2006-09-07 01:45 PM
Re: Mapping network drives
|
Björn
Korg Regular
   
Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
|
that part is in the way you call it - ie there's a big nice faq for the different ways to call the scripts You get a error msg regarding that the kix-executable can't find the script, or that the kix-executable cannot be found? map a drive against the netlogon, run it from there (ie z:\kix32 test.kix)
|
|
Top
|
|
|
|
#166971 - 2006-09-07 02:13 PM
Re: Mapping network drives
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Code:
SetOption("Explicit","On")
shows on your screen Code:
OFF
I do not want to show ANY information to users in an uncontrolled way. It leeds to confusion and is misunderstood. Code:
$SO = DelTree("HKEY_CURRENT_USER\Software\KiXtart\TokenCache")
This line is just needed while you are testing and are hopping in and out groups to see if it all works. You should get rid of it as soon as you do not need it anymore. The cache will speed up mapping drives.
|
|
Top
|
|
|
|
#166974 - 2006-09-07 02:39 PM
Re: Mapping network drives
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
I more like the robust approach, but there is IMHO an error in the text about the Win9x command line. In the list to find OS's you may want to add the newer ones as you need them. Code:
@ECHO off SETLOCAL
REM First line will find W2K3 For Terminal Sessions VER | find "5.2.3790" > nul If NOT errorlevel 1 GoTo Win_NT
VER | find "NT" > nul If NOT errorlevel 1 GoTo Win_NT
VER | find "2000" > nul If NOT errorlevel 1 GoTo Win_NT
VER | find "XP" > nul If NOT errorlevel 1 GoTo Win_NT
VER | find "98" > nul If NOT errorlevel 1 GoTo Win_9X
VER | find "95" > nul If NOT errorlevel 1 GoTo Win_9X
GoTo unknown_os
:win_NT Call wkix32.exe login.kix /i GoTo end
:win_9X %0\..\wkix32.exe %0\..\login.kix /i GoTo end
:unknown_os :end
Now if any code fails on NT because you did not map to Z: during logon I think it is time to get rid of that coding. This is just my opinion. Everybody has to find solutions to his own needs.
|
|
Top
|
|
|
|
#166976 - 2006-09-07 02:49 PM
Re: Mapping network drives
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Now for testing, I don't think you have to logoff and logon every time. If you know what you are doing, you can make a simple script that removes all drive mappings, printer mappings etc. I presume you are storing the test login script in the netlogon share. Just start it p.e. like this: Code:
\\domainname\netlogon\wkix32 \\domainname\netlogon\test.kix
|
|
Top
|
|
|
|
#166978 - 2006-09-07 03:12 PM
Re: Mapping network drives
|
Björn
Korg Regular
   
Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
|
Ya, noticed But you're right to fix it the right way from start - but from my experience it still can be messy when trying to call the batchfile after logon.
|
|
Top
|
|
|
|
#166980 - 2006-09-07 03:41 PM
Re: Mapping network drives
|
Björn
Korg Regular
   
Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
|
heh, it WAS messy, until I read your link a while back and fixed it Tho, we have always based things on os-type/version.
|
|
Top
|
|
|
|
#166981 - 2006-09-07 04:19 PM
Re: Mapping network drives
|
ddady
Getting the hang of it
Registered: 2006-09-03
Posts: 98
|
Thanx guys,
but i'm still a little confused . Let say i have a file named test.kix and i want to run it in order to see what it does. For example while i login a computer the file login.kix is running and shows me a command windows and there for an example it says "Installing Network Printers Please Wait..."
Now, i want to run a test.kix file that print something on the command window, how do i do it without running the login.kix file everytime, only when i will be satisfied with the code on test.kix then i will copy it to the login.kix file?
Edited by ddady (2006-09-07 04:22 PM)
|
|
Top
|
|
|
|
#166983 - 2006-09-07 05:07 PM
Re: Mapping network drives
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
ddady
Quote:
"Installing Network Printers Please Wait..."
IIWY, I would get rid of that screen output. Also because just behind that screen output, you make your users wait for 5 looooong seconds.
|
|
Top
|
|
|
|
#166984 - 2006-09-10 07:42 AM
Re: Mapping network drives
|
ddady
Getting the hang of it
Registered: 2006-09-03
Posts: 98
|
Sorry for my late reply, i took the weekend off.
Thanx richard and witto.
Witto: anyway the have to wait a few seconds while the printers installed, i wrote that line before the actual installing code so it stays as long as it take the printers to be installed.
Richard: i will try it today.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 1198 anonymous users online.
|
|
|