Page 1 of 1 1
Topic Options
#122063 - 2004-07-02 10:36 AM Using compiled Kix script with parameters
acmp Offline
Getting the hang of it

Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
Hi,

I have written a bit of script to interface with GhostScript to allow network users to drop postscript files into a network drive and get them converted to PDF. It works quite well.

My problem is that we have several locations that we use for different PDF's. What I want to do is compile my script to an exe so I can use it as a service, and pass the basic path information to the script as a parameter.

I've had a bit of a play and think that this may not be possible. I hope that someone can either confirm my fears or advise a soloution.

I'm running on Windows NT/2000 if that makes a difference.

acmp<><
_________________________
Every day is a school day

Top
#122064 - 2004-07-02 10:42 AM Re: Using compiled Kix script with parameters
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Using KiXtart as a service hase been discussed on the board a number of times, indeed there was a conversation quite recently.

Use the search facility to find the threads. Make sure you change the search parameters to use "AND" rather than "entire phrase", and change the search period to something greater than the default.

Top
#122065 - 2004-07-02 11:43 AM Re: Using compiled Kix script with parameters
acmp Offline
Getting the hang of it

Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
I must be having a bad day. I can't find any useful threads.

I have searched for various things including:
service
parameter
pass
compiled
exe

And no joy, any chance you could help me out?

BTW: I don't have a problem with setting an exe as a service on an NT4/5/6 box,
it's the passing parameters to kix that is giving me a headach.

acmp<><
_________________________
Every day is a school day

Top
#122066 - 2004-07-02 12:08 PM Re: Using compiled Kix script with parameters
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Not sure why you had problems - a search for "service" turned up this recent thread immediately:
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=120297&page=&view=&sb=5&o=&vc=1

To pass a parameter to KiXtart, you may either use an environment variable which is directly accessible in your script, or pass them on the command line:
Code:
kix32.exe myscript.kix $foo="BAR"



This will set variable "$foo" to "BAR" in your script.

Top
#122067 - 2004-07-02 12:28 PM Re: Using compiled Kix script with parameters
acmp Offline
Getting the hang of it

Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
I think I know the problem...

I'm not interested in services as such. What I want is to be able to pass
parameters to a compiled kix script.

I want to use the compiled script (whatever.exe) with parameters ie.
whatever.exe $path=\\server\share
The reason is that I can then use the exe file with different params to check
different folders. If I hard code the path info then I'll have to recompile
the script everytime I add or change a path.

I think my reference to running it as a service has misled the thread.

I hope this is clearer.

acmp<><
_________________________
Every day is a school day

Top
#122068 - 2004-07-02 02:11 PM Re: Using compiled Kix script with parameters
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
You cannot (yet) compile KiXtart - you may package it however.

The ability to pass parameters on the command line is a feature of the packager, not KiXtart.

KiXtart can accept command line parameters as I detailed in my previous post. You will need to refer to the packager documentation to determine whether it will pass on command line parameters.

If the packager will not pass on command line parameters then use environment variables or a registry entry to pass the information to the script.

Top
#122069 - 2004-07-03 03:15 PM Re: Using compiled Kix script with parameters
acmp Offline
Getting the hang of it

Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
Thanks,

I hadn't thought of using registry values. I can just knock up a simple
interface script to set and modify them and use that.

acmp<><
_________________________
Every day is a school day

Top
#122070 - 2004-07-08 03:31 PM Re: Using compiled Kix script with parameters
acmp Offline
Getting the hang of it

Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
Gave up with the registry and I am now using an INI file. It works a treat.

acmp<><
_________________________
Every day is a school day

Top
#122071 - 2004-07-12 03:21 PM Re: Using compiled Kix script with parameters
acmp Offline
Getting the hang of it

Registered: 2004-07-02
Posts: 69
Loc: Bingham, Nottinghamshire, Engl...
Thanks for the ideas and such on this.

I just found a GetOption() UDF over at kixhelp:
http://www.kixhelp.com/udfs/udf/83476.htm

That looks as though it will take command line parameters from a packaged Kix script and let you reference them.

ho hum...

acmp<><
_________________________
Every day is a school day

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 515 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.062 seconds in which 0.022 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