Page 2 of 2 <12
Topic Options
#168657 - 2006-10-11 07:13 PM Re: using exist with unc not working
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
I presume you are not using the latest KiX version?
Code:

If NOT @LOGONMODE
Break On
EndIf
If Exist("\\@WKSTA\C$\")
? "Yeah"
Else
? "No"
EndIf
? "Error " + @ERROR + ": " + @SERROR
? "KiX Version: " + @KIX


Returns for me
Code:

Yeah
Error 0: The operation completed successfully.
KiX Version: 4.53


What do you get?

Top
#168658 - 2006-10-11 07:35 PM Re: using exist with unc not working
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, that's the weird thing.
he said he used 4.53 and that surely has no issue with undoubled $.

checked and 4.10 is the first version that does not require doubling the $ sign.
so, he is using really old version.

Top
#168659 - 2006-10-12 06:11 PM Re: using exist with unc not working
jconway Offline
Fresh Scripter

Registered: 2002-02-26
Posts: 16
Quote:

well, that's the weird thing.
he said he used 4.53 and that surely has no issue with undoubled $.

checked and 4.10 is the first version that does not require doubling the $ sign.
so, he is using really old version.




I just verified all servers and infact all are using kix32.exe 4.53.0

here is the working code.
Code:
$dest = "\\" + @WKSTA + "\d$$\imas\kix\scripts"
$source = "\\unpiox54pn\UHT_IMAS\Citrix\kix\Scripts\*.*"
If Not Exist($dest)
MD "\\" + @WKSTA + "\d$$\imas\kix\scripts"
EndIf
Shell '%COMSPEC% /c xcopy /E /Q /Y "'+$Source+'" "'+$Dest+'"'


Top
#168660 - 2006-10-12 06:37 PM Re: using exist with unc not working
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Am I missing something?
Both work for me with 4.53...
Ran each code twice. First time got "No" and the directory is created. Second time got "Yes".
With each of the scripts.
Code:

Break On
$dest = "\\" + @WKSTA + "\c$\script\blablabla"
If NOT Exist($dest)
?"No"
MD $dest
Else
?"Yes"
EndIf
? "Error " + @ERROR + ": " + @SERROR
? "KiX Version: " + @KIX


Code:

Break On
$dest = "\\" + @WKSTA + "\c$$\script\blablabla"
If NOT Exist($dest)
?"No"
MD $dest
Else
?"Yes"
EndIf
? "Error " + @ERROR + ": " + @SERROR
? "KiX Version: " + @KIX


Top
#168661 - 2006-10-12 07:20 PM Re: using exist with unc not working
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
No
Error 53: The network path was not found.
KiX Version: 4.53


However I used this at the top of the script.

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




So I would say it is the forgiving nature of KiXtart, though to me almost rather a BUG
I see it potentially allowing a copy that should not be allowed maybe.

Top
#168662 - 2006-10-12 07:29 PM Re: using exist with unc not working
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
So Doc, you agree, like Jooel says, no need to double the $ ?
Top
#168663 - 2006-10-12 07:31 PM Re: using exist with unc not working
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Correct, there is no need to and if you add the HEADER as I have it will in fact error out.

However without ANY type of SetOptions it does appear to work which to me is sort of a bug, but I think Ruud wants/allows it to work that way on purpose.

Top
#168664 - 2006-10-13 03:13 PM Re: using exist with unc not working
jconway Offline
Fresh Scripter

Registered: 2002-02-26
Posts: 16
Well, then lets discuss the set options and why it does work without them, versus why it does not work with the single $ or the $$ as the code stands.
    there is no reasonable possibility short of OS issues that the root admin hidden shares would not exist. Thus the reason I do not check for it

    as documented in the help file and other documents I have read, my approach is a completely reasonable and efficient approach to accomplishing the end goal.

Is there a better way to approach this within kix that I am missing? Please show or explain to me how and why? Really, I do not pretend to be an expert in anything.

Top
#168665 - 2006-10-13 04:08 PM Re: using exist with unc not working
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
When KiXtart was first released, variables and macros were used in strings.
To indicate that a value with a $ is not a variable, or a value with a @ is not a macro, you have to double that sign.
"$var" is referring to a var
"@KIX" is referring to a macro
"$$var" is the string $var
"@@KIX" is the string @KIX
"var$" is no variable but refers to a hidden share, like "\\server\var$\deeper"
Apparently, in early versions of KiXtart, you had to write: "\\server\var$$\deeper"
Now with the options NoVarsInStrings and NoMacrosInStrings set to On, you should get your variables and macros out of your strings. If you set NoVarsInStrings to On, you should also never double the $ in "\\server\var$\deeper".

So What I do not understand in your answer to your own question: you have KiX 4.53 and you say that you have a problem with a string like "\\server\var$\deeper"

To answer your question about the approach
I would:
- Set Break On in logon scripts
- Set Break Off in any other script
- Set Option Explicit to have to declare and for not mistyping my variables
- Set Option NoVarsInStrings On and get Vars out of strings
- Set Option NoMacrosInStrings On and get Macros out of strings
- Set Option WrapAtEOL to On to have a good idea about long screen output during coding
But of course, these are my personal preferences
Code:

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


Top
Page 2 of 2 <12


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

Who's Online
0 registered and 318 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.424 seconds in which 0.057 seconds were spent on a total of 12 queries. Zlib compression enabled.

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