#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: 4401
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
|
|
|
|
script runs, but use command gives error
|
rawsonm
|
2007-10-18 05:29 PM
|
Re: script runs, but use command gives error
|
NTDOC
|
2007-10-18 07:21 PM
|
Re: script runs, but use command gives error
|
noobness
|
2007-10-18 07:34 PM
|
Re: script runs, but use command gives error
|
Glenn Barnas
|
2007-10-18 07:39 PM
|
Re: script runs, but use command gives error
|
rawsonm
|
2007-10-19 05:58 PM
|
Re: script runs, but use command gives error
|
Glenn Barnas
|
2007-10-19 08:55 PM
|
Re: script runs, but use command gives error
|
rawsonm
|
2007-10-26 03:32 PM
|
Re: script runs, but use command gives error
|
NTDOC
|
2007-10-26 07:36 PM
|
Re: script runs, but use command gives error
|
Witto
|
2007-10-26 07:45 PM
|
Re: script runs, but use command gives error
|
rawsonm
|
2007-11-01 08:00 PM
|
Re: script runs, but use command gives error
|
Glenn Barnas
|
2007-11-01 08:31 PM
|
Re: script runs, but use command gives error
|
rawsonm
|
2007-11-02 01:32 AM
|
Re: script runs, but use command gives error
|
Richard H.
|
2007-11-02 09:32 AM
|
Re: script runs, but use command gives error
|
NTDOC
|
2007-11-02 02:55 AM
|
Re: script runs, but use command gives error
|
Glenn Barnas
|
2007-11-02 12:28 PM
|
Re: script runs, but use command gives error
|
Benny69
|
2007-11-02 12:58 PM
|
Re: script runs, but use command gives error
|
Glenn Barnas
|
2007-11-02 02:20 PM
|
Re: script runs, but use command gives error
|
Allen
|
2007-11-02 02:39 PM
|
Re: script runs, but use command gives error
|
Benny69
|
2007-11-02 02:46 PM
|
Re: script runs, but use command gives error
|
Glenn Barnas
|
2007-11-02 02:55 PM
|
Re: script runs, but use command gives error
|
Richard H.
|
2007-11-02 06:30 PM
|
Re: script runs, but use command gives error
|
Howard Bullock
|
2007-11-04 01:39 PM
|
Re: script runs, but use command gives error
|
NTDOC
|
2007-11-03 05:38 AM
|
Re: script runs, but use command gives error
|
Glenn Barnas
|
2007-11-03 01:43 PM
|
Re: script runs, but use command gives error
|
Mart
|
2007-11-03 04:33 PM
|
Re: script runs, but use command gives error
|
Les
|
2007-11-02 02:17 AM
|
Re: script runs, but use command gives error
|
rawsonm
|
2007-11-01 07:57 PM
|
Re: script runs, but use command gives error
|
NTDOC
|
2007-10-26 07:48 PM
|
Re: script runs, but use command gives error
|
NTDOC
|
2007-10-26 07:16 PM
|
Re: script runs, but use command gives error
|
Glenn Barnas
|
2007-10-26 08:15 PM
|
Re: script runs, but use command gives error
|
Richard H.
|
2007-10-23 01:24 PM
|
Re: script runs, but use command gives error
|
Glenn Barnas
|
2007-10-23 01:41 PM
|
Re: script runs, but use command gives error
|
NTDOC
|
2007-10-23 11:11 PM
|
Re: script runs, but use command gives error
|
Glenn Barnas
|
2007-10-24 04:22 AM
|
Re: script runs, but use command gives error
|
NTDOC
|
2007-10-24 09:21 AM
|
Re: script runs, but use command gives error
|
Arend_
|
2007-10-24 09:50 AM
|
Re: script runs, but use command gives error
|
Gargoyle
|
2007-10-24 03:21 PM
|
Re: script runs, but use command gives error
|
Arend_
|
2007-10-23 01:38 PM
|
Re: script runs, but use command gives error
|
Witto
|
2007-10-19 07:02 PM
|
Re: script runs, but use command gives error
|
Gargoyle
|
2007-10-19 08:27 PM
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 1198 anonymous users online.
|
|
|