Page 1 of 1 1
Topic Options
#35492 - 2003-01-22 01:38 PM If Ingroup + Variables
Mike Duhwald Offline
Fresh Scripter

Registered: 2003-01-13
Posts: 40
Hi Forum Users,
I want to create a a script which check the membership of the user an than set some variables depending of this membership.

How can I realize this?

Regards
Mike

Top
#35493 - 2003-01-22 03:23 PM Re: If Ingroup + Variables
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Search the board and manual for INGROUP, ENUMLOCALGROUP, and ENUMGROUP. then couple that with the IF...Endif construct.

[ 22. January 2003, 15:24: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#35494 - 2003-01-22 05:26 PM Re: If Ingroup + Variables
Mike Duhwald Offline
Fresh Scripter

Registered: 2003-01-13
Posts: 40
Hi,
thanks for your answer. A nice bunch of Tipps I found there... - but I must SET more than one environment variable in this if...endif loop. how can I glue this together?

Regards
Mike

Top
#35495 - 2003-01-22 05:40 PM Re: If Ingroup + Variables
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Do you have any code for us to examine that would better clarify your needs?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#35496 - 2003-01-22 06:22 PM Re: If Ingroup + Variables
Mike Duhwald Offline
Fresh Scripter

Registered: 2003-01-13
Posts: 40
Hi,
for sure:

If Ingroup xxxx
SET TEST=xxx + SET TEST1=XXX + SET .. + ..
use X: "\\SERVER\SHARE"
Endif

Regards
Mike

Top
#35497 - 2003-01-22 06:32 PM Re: If Ingroup + Variables
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I must be thick today. Can you explain what you are trying to accomplish by:

SET TEST=xxx + SET TEST1=XXX + SET .. + ..

I can't find any logic in it.
quote:
Set

Action: Sets environment variables in the environment of the current user (HKEY_CURRENT_USER\Environment).

Syntax: SET "variable=string"

Remarks: After any change to the environment, KiXtart informs running programs that the change was made, prompting them to regenerate their environments. Programs that support this feature (such as Program Manager, Task Manager, and Windows Explorer) update their environments when they receive the WM_SETTINGCHANGE message.
The environment of the current process (KiXtart 95) is not affected.
This command does not work on Windows 9x. As an alternative, use the SHELL command to run Winset.exe. (Winset.exe is included on the Windows 9x CD.)


See Also: SetL, SetM

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#35498 - 2003-01-22 06:34 PM Re: If Ingroup + Variables
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Howard,
My take is that he is trying to do:

If Ingroup xxxx
 SET TEST=xxx
 SET TEST1=XXX
 SET ...
 use X: "\\SERVER\SHARE"
Endif
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#35499 - 2003-01-23 08:05 AM Re: If Ingroup + Variables
Mike Duhwald Offline
Fresh Scripter

Registered: 2003-01-13
Posts: 40
Hi,
for sure. I want to set some environment variables in a row. In Batch I can set them by:

SET SERVER=W2KSRV&& SET EXCHANGE=E2KSRV && ...

Now I want this variables and the drivemapping be set by groupmembership with KIX. I hope that I explained it better than before!?

Regards
Mike

Top
#35500 - 2003-01-23 08:11 AM Re: If Ingroup + Variables
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
mike, that script bit les just showed is exactly what you want.
_________________________
!

download KiXnet

Top
#35501 - 2003-01-23 03:41 PM Re: If Ingroup + Variables
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Mike:

KiXtart syntax is different than batch syntax. Please take a loop at the KiXtart Manual. Example code could look like this:
code:
IF INGROUP('Domain Users')
SET 'Test=Domain Users'
SET 'Test1=Domain Users'
ENDIF

or
code:
$groups='Group A, Group B, Group C'
$groups=split($groups,',')
for each $group in Groups
if ingroup($group)
set 'Test='+$group
set 'Trst1='+$group1
endif
next



[ 23. January 2003, 15:44: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.075 seconds in which 0.039 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