acmp
(Getting the hang of it)
2004-07-02 10:36 AM
Using compiled Kix script with parameters

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<><


Richard H.Administrator
(KiX Supporter)
2004-07-02 10:42 AM
Re: Using compiled Kix script with parameters

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.


acmp
(Getting the hang of it)
2004-07-02 11:43 AM
Re: Using compiled Kix script with parameters

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<><


Richard H.Administrator
(KiX Supporter)
2004-07-02 12:08 PM
Re: Using compiled Kix script with parameters

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.


acmp
(Getting the hang of it)
2004-07-02 12:28 PM
Re: Using compiled Kix script with parameters

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<><


Richard H.Administrator
(KiX Supporter)
2004-07-02 02:11 PM
Re: Using compiled Kix script with parameters

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.


acmp
(Getting the hang of it)
2004-07-03 03:15 PM
Re: Using compiled Kix script with parameters

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<><


acmp
(Getting the hang of it)
2004-07-08 03:31 PM
Re: Using compiled Kix script with parameters

Gave up with the registry and I am now using an INI file. It works a treat.

acmp<><


acmp
(Getting the hang of it)
2004-07-12 03:21 PM
Re: Using compiled Kix script with parameters

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<><