#65172 - 2002-05-03 01:36 PM
Var-Label @error
|
Ronald
Fresh Scripter
Registered: 2001-02-13
Posts: 27
Loc: Netherlands
|
Hi there,
I hope you can help me!
I use the readvalue to get a domain. Then it has to be showed in the screen. For example I'll use for the domain: TEST1 It seems like this :
$RdvDom=ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSNP32\NetworkProvider","AuthenticatingAgent")
? "$$RdvDom = $Rdvdom"
Displayed : $RdvDom = TEST1
The script where I need this part for will run over more domains. There all domains have separate configurations, I use different Labels.
I want to use the readvalue into a label. Such like this:
While @error=0 goto $Rvd Endif
? "Not logged on to an active Domain !!!" Exit
:TEST1 ? "CONFIGs for clients which logged on to Domain TEST1" Exit
:TEST2 ? "CONFIGs for clients which logged on to Domain TEST2" Exit
:Test3 ? "CONFIGs for clients which logged on to Domain TEST3" Exit
I hope you do understand my problem.
Thnx a lot for the one who can help me !!!!
Greetings Ro!
|
|
Top
|
|
|
|
#65175 - 2002-05-03 03:34 PM
Re: Var-Label @error
|
Ronald
Fresh Scripter
Registered: 2001-02-13
Posts: 27
Loc: Netherlands
|
This is the active script:
$RdvDom=ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSNP32\NetworkProvider","AuthenticatingAgent")
? "$$RdvDom = $Rdvdom" ?
IF @error=0 goto $Rdv Endif
? "No active domain!!!" ? exit ENDIF
:$Rdv ? " Logged on to Domain: TEST1 " EXIT
But the output is Still:
$RdvDom = TEST1 script error : LABEL not found ! Endif
So, it doesn't work already! Can you show me an example by this script ?
Thnx a lot ! [ 03 May 2002, 15:36: Message edited by: Ronald ]
|
|
Top
|
|
|
|
#65178 - 2002-05-03 06:39 PM
Re: Var-Label @error
|
Ronald
Fresh Scripter
Registered: 2001-02-13
Posts: 27
Loc: Netherlands
|
Thnx!
I figured out (with your help) what was wrong. I tried already like you did it in the last post.
I renameld the value to TEST1, it worked !
But in real the name of domains is like this.
"name-tt111"
But she can't figure the "-" in a label so, that's the problem which I have to resolve.
Thnx! for your help.
Greetings Ro!
|
|
Top
|
|
|
|
#65179 - 2002-05-05 10:47 PM
Re: Var-Label @error
|
Ronald
Fresh Scripter
Registered: 2001-02-13
Posts: 27
Loc: Netherlands
|
Hi there...
The way I solved the "dash" ("-")-problem is written in the script below !
I could work with :
;*========================== If $RdvDom="name-tt111" goto "namett111" Endif
If $RdvDom="paas-ww253" goto "paas-ww253" Endif
;==========================
Etc. But If you've got 80 Domains for example...I think that this is a better way.
So see my script below...It works...But if you have a better (read smaller) method...let me know...The more possibilities you know the better, I always say !
Well see you !
Greetings Ro!
[SCRIPT] ;***************** ;* Check Domain * ;***************** :Domchk
$RdvDom = ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSNP32\NetworkProvider","AuthenticatingAgent")
? "$$RdvDom = $Rdvdom"
If @error=0 $x = Instr($RdvDom,"-") ? "$$x = $x" If $x >0 ? "yes"
$x1=$x-1 $x2=$x+1
? "$$x1 = $x1" ? "$$x2 = $x2"
$sub1=substr($RdvDom,1,$x1) $sub2=substr($RdvDom,$x2,20)
? "$$sub1 = $sub1" ? "$$sub2 = $sub2"
$Domain = (($sub1)+($sub2)) ? "$$Domain = $Domain"
goto $Domain Endif
[END OF SCRIPT]
|
|
Top
|
|
|
|
#65182 - 2002-05-05 11:38 PM
Re: Var-Label @error
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
If the clients logon to different domains, it may be easier and more productive to use sub-scripts. If there is unique functionality that occurs for each different domain, why should everyone load and execute code that does not pertain to them? Also if you have to edit the functionality of domain "TEST1" and make a syntax error, then the script will die for everyone.
I suggest the you use a "CALL" command to call a sub-scripts named after the domain.
;Get domain name from registry $Domain = ReadValue(... Call $Domain + ".kix"
This permits to edit the functionality of a particular domain without affecting anyone else. [ 05 May 2002, 23:42: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#65184 - 2002-05-05 11:56 PM
Re: Var-Label @error
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
You know... If they logon to different domains they all could and probably should just have their own script since only users for that domain would read the script anyway.
Now if they had a master domain model where everyone executes the same script, the call subscript would work wonders for clients of 80 different resource domains.
Example Call @domain + ".kix"
|
|
Top
|
|
|
|
#65186 - 2002-05-06 12:27 AM
Re: Var-Label @error
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
@Domain for my Master Domain Model example. @Ldomain for Ronald. Not sure why he is reading the registry. Did I miss something?
|
|
Top
|
|
|
|
#65188 - 2002-05-06 09:26 AM
Re: Var-Label @error
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
My Scripts not working
Please advise
Thanks
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 884 anonymous users online.
|
|
|