#182175 - 2007-11-01 07:57 PM
Re: script runs, but use command gives error
[Re: Witto]
|
rawsonm
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
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
|
|
|
|
#182187 - 2007-11-02 01:32 AM
Re: script runs, but use command gives error
[Re: Glenn Barnas]
|
rawsonm
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
|
|
|
|
#182192 - 2007-11-02 12:28 PM
Re: script runs, but use command gives error
[Re: NTDOC]
|
Glenn Barnas
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:
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!
|
Top
|
|
|
|
#182193 - 2007-11-02 12:58 PM
Re: script runs, but use command gives error
[Re: Glenn Barnas]
|
Benny69
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 ?
|
Top
|
|
|
|
#182195 - 2007-11-02 02:20 PM
Re: script runs, but use command gives error
[Re: Benny69]
|
Glenn Barnas
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!! (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!
|
Top
|
|
|
|
#182203 - 2007-11-02 02:46 PM
Re: script runs, but use command gives error
[Re: Allen]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
you guys are tooo funny
|
Top
|
|
|
|
#182221 - 2007-11-03 05:38 AM
Re: script runs, but use command gives error
[Re: Richard H.]
|
NTDOC
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
|
|
|
|
#182229 - 2007-11-04 01:39 PM
Re: script runs, but use command gives error
[Re: Richard H.]
|
Howard Bullock
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.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 248 anonymous users online.
|
|
|