Page 1 of 1 1
Topic Options
#121225 - 2004-06-15 12:02 AM Newbie Question Retrieve command Line Arguments
MrLee Offline
Lurker

Registered: 2004-06-14
Posts: 2
I'm trying to run a script with a command line variable like this:

Kix32 testscript.kix "WhattoPass"

How do I retrieve "whattopass" inside the script. I've tried reading %1 and It's not there.
Please help!!
Thanks.
Lee

Top
#121226 - 2004-06-15 12:23 AM Re: Newbie Question Retrieve command Line Arguments
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
From the manual:

Optionally, variables can be created and assigned a value on the commandline with which KiXtart is started. To do this, type the variable name followed by an equal sign (=) and the value the variable should have. For example:

KIX32 Demo.kix $Key=Value


It is a little difficult to find.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#121227 - 2004-06-15 03:30 PM Re: Newbie Question Retrieve command Line Arguments
MrLee Offline
Lurker

Registered: 2004-06-14
Posts: 2
There's no cleaner way to do this?
I'd prefer to have a line that just passes an argument.

Here's my scenario:
Microsoft's IfMember.exe does not work very well, it's especially delerious if you read "across" domains. I can use the ingroup function of kix to create a custom ifmember.
I'd like to make a line like this: ifmember "Domain\MyGroup"

not ifmember var="Domain\MyGroup"

Top
#121228 - 2004-06-15 03:52 PM Re: Newbie Question Retrieve command Line Arguments
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
No!
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#121229 - 2004-06-15 04:07 PM Re: Newbie Question Retrieve command Line Arguments
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Here's the kix version of ifmember.exe:

[ifmember.kix]
Code:

break on

exit ingroup($group)



call it like this:

C:\> kix32 ifmember.kix $group="Administrators"

then you can check:

C:\> echo %errorlevel%
1

-Shawn

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
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.057 seconds in which 0.029 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