Page 2 of 2 <12
Topic Options
#182007 - 2007-10-26 07:48 PM Re: script runs, but use command gives error [Re: Witto]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Actually that is old documentation and not using quotes on the driver letter works perfectly fine.

Regardless that would NOT prevent the script from running.

Top
#182008 - 2007-10-26 08:15 PM Re: script runs, but use command gives error [Re: NTDOC]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
 Originally Posted By: NTDOC
Think the guys were joking with you a bit. There is no "Windows 2003 advanced server"


You didn't think the advice here was "free", did ya? ;\)
Certainly not free of teasing, joking, and general good-natured (mostly) ribbing.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#182175 - 2007-11-01 07:57 PM Re: script runs, but use command gives error [Re: Witto]
rawsonm Offline
Fresh Scripter

Registered: 2007-10-18
Posts: 6
Hello Glenn,

I ran your trouble shooting script and found that it has problems only with the use command. Everything else in the scipt runs ok. The use command exits with a 0 code and says that is completed ok, but there is no mapping.

I think that I might have found the problem. Most shares that I map with the login script are regular shares, not $ hidden ones. Is there anything special I need to do since the shares that I am mapping are hidden NT/2000 shares? I have never tried to use Kix to map a hidden share before.

Side question, when do you use wkix32?

thanks
mark


Edited by rawsonm (2007-11-01 07:58 PM)

Top
#182176 - 2007-11-01 08:00 PM Re: script runs, but use command gives error [Re: Witto]
rawsonm Offline
Fresh Scripter

Registered: 2007-10-18
Posts: 6
Hello

I think I found the problem. This is the first time that I have tried to map to a hidden share $ with the kix script. In the past, all shares have been regular ones. What do I need to know about using the Kix use command with hidden network shares?

mark

Top
#182177 - 2007-11-01 08:31 PM Re: script runs, but use command gives error [Re: rawsonm]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Regarding the share mapping, it might be good for you to start with a clean slate - removing existing shares and disabling share persistence.

As for WKix/Kix - on my systems, I associate .KIX with Kix32 and .KXW with WKix32. This is done only on servers and admin workstations - not universally. If I'm running a .KIX script, it's always at the command line (I will never launch a script of any kind via double-clicks in explorer!), so Kix32 is appropriate. If my script is a system service, or uses Kixforms GUI, it has a .KXW extension. These usually have desktop or start-menu icons, since the interface is graphical.


Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#182187 - 2007-11-02 01:32 AM Re: script runs, but use command gives error [Re: Glenn Barnas]
rawsonm Offline
Fresh Scripter

Registered: 2007-10-18
Posts: 6
Hello

I tested tonight and have confirmed the issue. Kix does not like to use the use command to map hidden shares. I removed the $ from all my shares and made them regular shares and the script ran fine and the mappings are there.

Thanks for all your help everyone.
mark

Top
#182188 - 2007-11-02 02:17 AM Re: script runs, but use command gives error [Re: rawsonm]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
What version of KiX?
Do you use any zero-length var names?
i.e.
$ = function()
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#182189 - 2007-11-02 02:55 AM Re: script runs, but use command gives error [Re: rawsonm]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Something in how you're coding as KiX has no problem mapping a hidden share. I use it here just fine.

Try adding this at the top of your script

If Not @LogonMode
Break On
EndIf
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('NoMacrosInStrings','On')
$SO=SetOption('WrapAtEOL','On')

Top
#182191 - 2007-11-02 09:32 AM Re: script runs, but use command gives error [Re: rawsonm]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
 Originally Posted By: rawsonm
I tested tonight and have confirmed the issue. Kix does not like to use the use command to map hidden shares.


This is not correct.

KiXtart has no problem mapping "hidden" shares where the share name is suffixed with a "$".

If you are having problems then it is something peculiar to your environment.

The only special handling that you need for hidden shared is that the trailing "$" may be considered to be a variable embedded in the string, in which case you need to ensure that it is protected.

However "hidden" shares are not any sort of security and only really useful for reducing clutter when browsing, so if you are happy with the solution of not using them then stick with that.

If you *do* need to map hidden shares with KiXtart then post again and we'll assist you in finding out why it's not working for you.

Top
#182192 - 2007-11-02 12:28 PM Re: script runs, but use command gives error [Re: NTDOC]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
I think Doc's got this nailed...

USE D: "\\server\hidden$"
will not work unless NoVarsInStrings is declared. However -
USE D: "\\server\hidden" + Chr(36)
will always work.

Without either of these minor modifications, Kix is treating the "$" at the end of the share name as a variable, and since the var "$" is likely empty, nothing (or something invalid) appears after the text part of the share name. This prevents it from mapping.

If you follow ALL of Doc's advice, however, be prepared for lots of other things failing. You said you got this script from work, and someone else wrote it?? If it wasn't written to the standards needed for all the SetOption values that Doc referenced, especially Explicit, more things will fail than will be fixed. Your code must be written to permit those settings (which are, in turn, designed to force good coding habits).

I'd suggest that you first map your hidden shares using the form
USE D: "\\server\hidden" + Chr(36)

Confirm that it works. Then, make a copy of the login script (kixtart2.kix) and add the SetOption statements Doc suggested. Run the script - when it fails due to an "Undefined Variable: xxx", you can add a statement to your code to declare it. You can simply DIM them all on one or two lines, but I now prefer one DIM per variable (or var group) with a comment that reminds me what they are for. For example:
 Code:
Dim $x,$y            ; Index pointers
Dim $aHosts, $Host   ; Array of host names, For/Each enumerator
Dim $Share           ; name of share to be mapped

You will also need to scan the code and change statements like this:
"You logged in at @TIME on @DATE" ?
to this:
"You logged in at " @TIME " on " @DATE ?
since macros will not be processed inside strings if you declare NoMacrosInStrings as he suggested.

Keep in mind that you SHOULD follow Doc's suggestions - they assure good coding practices and eliminate many problems such as you are encountering. The caveat is that they ENFORCE good practices - if your code isn't written that way, it won't help. It's not a magic bullet or anything..

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#182193 - 2007-11-02 12:58 PM Re: script runs, but use command gives error [Re: Glenn Barnas]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
I am sure Glen just had a typo, but:
this:
"You logged in at @TIME on @DATE" ?
should be:
"You logged in at " + @TIME + " on " + @DATE ?
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#182195 - 2007-11-02 02:20 PM Re: script runs, but use command gives error [Re: Benny69]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
No, it shouldn't. The "+" is required only if you are building a string for assignment, not if you are simply printing. It's allowed to use concatenation in output, but it's definitely not required. If you think about the manual reference, any string or variable not part of an "assignment" is simply output. So - my presentation is simply the output of a series of fixed strings and variables.

Besides, Dale, if anyone had a typo, it's you! I have TWO "n"'s in my name!! \:D (and while you prolly wouldn't want me to call you "Dal", "Ale" might be interesting for a bit.. ;\) )

Glenn

PS - I'm not sensitive about the spelling, but enjoy every opportunity to tease!
_________________________
Actually I am a Rocket Scientist! \:D

Top
#182202 - 2007-11-02 02:39 PM Re: script runs, but use command gives error [Re: Glenn Barnas]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Glenn of all people, has no business telling people how to spell names (sheesh!)
Top
#182203 - 2007-11-02 02:46 PM Re: script runs, but use command gives error [Re: Allen]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
you guys are tooo funny ;\)
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#182204 - 2007-11-02 02:55 PM Re: script runs, but use command gives error [Re: Benny69]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Wassup with you, Alan? er.. Allen! \:D
_________________________
Actually I am a Rocket Scientist! \:D

Top
#182206 - 2007-11-02 06:30 PM Re: script runs, but use command gives error [Re: Glenn Barnas]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
I feel your pain, I spend so much time being Howard I'm officially liable for double taxation!
Top
#182221 - 2007-11-03 05:38 AM Re: script runs, but use command gives error [Re: Richard H.]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
What did you say Howard, you're feeling pain? Take two aspirin and call me in the morning. ;\)
Top
#182223 - 2007-11-03 01:43 PM Re: script runs, but use command gives error [Re: NTDOC]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Hmm..

I thought it would have been "perform two netstats and ping me in the morning".

G-
_________________________
Actually I am a Rocket Scientist! \:D

Top
#182225 - 2007-11-03 04:33 PM Re: script runs, but use command gives error [Re: Glenn Barnas]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
LOL
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#182229 - 2007-11-04 01:39 PM Re: script runs, but use command gives error [Re: Richard H.]
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Richard, It ia good the you represent me on the board during the time when my visits are not so frequent.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 2 of 2 <12


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

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.068 seconds in which 0.024 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