Page 2 of 3 <123>
Topic Options
#166966 - 2006-09-07 11:02 AM Re: Mapping network drives
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Much simpler to create a share where you want it to map than dealing with SUBST (imho).
Top
#166967 - 2006-09-07 12:46 PM Re: Mapping network drives
ddady Offline
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
#166968 - 2006-09-07 01:07 PM Re: Mapping network drives
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
$SO will trap the returncode, thus $SO=SetOption("something","on")
will not print the 'result', while just SetOption("something","on") will.

Top
#166969 - 2006-09-07 01:40 PM Re: Mapping network drives
ddady Offline
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 Offline
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 Offline
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
#166972 - 2006-09-07 02:17 PM Re: Mapping network drives
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
You should read A Logon Script Does Not Work If %0 or %0\..\ Calls Multiple Commands about the usage of %0 in logon batch files. I think it is a bad idea to map the logon drive to z: to work around the problem.
Top
#166973 - 2006-09-07 02:20 PM Re: Mapping network drives
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
I agree that it is a bad idea, but doing that removes the need to edit something that does work during logon.
Top
#166974 - 2006-09-07 02:39 PM Re: Mapping network drives
Witto Offline
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
#166975 - 2006-09-07 02:42 PM Re: Mapping network drives
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
hold on a min - didn't say anything about mapping during logon and run it that way, that was my answer to what do to instead of loging in and out all the time since running the batchfile gave him errors.
Top
#166976 - 2006-09-07 02:49 PM Re: Mapping network drives
Witto Offline
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
#166977 - 2006-09-07 02:50 PM Re: Mapping network drives
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
OK, just misunderstood about mapping drive z:
Top
#166978 - 2006-09-07 03:12 PM Re: Mapping network drives
Björn Offline
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
#166979 - 2006-09-07 03:24 PM Re: Mapping network drives
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Why messy? It is robust. If none of the OS versions are found, it just quits. I think you still should find and define the mess. If there is logic in the mess, it can (most of the time) be solved.
Calling the logon batch file is (one of) the way(s) ddady has to work, as he still has W9x workstations.


Edited by Witto (2006-09-07 03:30 PM)

Top
#166980 - 2006-09-07 03:41 PM Re: Mapping network drives
Björn Offline
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 Offline
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
#166982 - 2006-09-07 04:24 PM Re: Mapping network drives
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
At a command prompt type:

\\path\to\kix32.exe \\path\to\test.kix

Top
#166983 - 2006-09-07 05:07 PM Re: Mapping network drives
Witto Offline
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 Offline
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
#166985 - 2006-09-10 09:59 AM Re: Mapping network drives
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
one question?
why to show anything to the users?
I bet they don't a sligthest bit.

Top
Page 2 of 3 <123>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.039 seconds in which 0.013 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org