#130273 - 2004-11-29 12:52 AM
Passing Info From Kixtart to NT Shell
|
drum15
Fresh Scripter
Registered: 2003-11-26
Posts: 5
Loc: Glasgow, Scotland, UK
|
Does anyone know how to pass information from Kix to NT Shell? Our login scripts are NT Shell, but we call some Kix scripts for some stuff. In particular I get Kix to do my AD queries, then I want to pass this info onto the NT Shell script that called my Kix Script for the Shell Script to deal.
|
Top
|
|
|
|
#130275 - 2004-11-29 01:09 AM
Re: Passing Info From Kixtart to NT Shell
|
drum15
Fresh Scripter
Registered: 2003-11-26
Posts: 5
Loc: Glasgow, Scotland, UK
|
Used the text file mechanism in the past. Just wondered if there was a "cleaner" way? Yeah could use KIX for the lot, but just inherited the way it is just now. Maybe one day when I've got time..... :smirk:
|
Top
|
|
|
|
#130277 - 2004-11-29 01:18 AM
Re: Passing Info From Kixtart to NT Shell
|
drum15
Fresh Scripter
Registered: 2003-11-26
Posts: 5
Loc: Glasgow, Scotland, UK
|
ok, cheers!
|
Top
|
|
|
|
#130278 - 2004-11-29 01:37 AM
Re: Passing Info From Kixtart to NT Shell
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I would really recommend that you revisit your script design and move the functionality in the Shell script into a Kixtart script. You would most likely be better served if your logon script was consolidated into KiX code. Oh, and this problem will no longer exist.
Edited by Howard Bullock (2004-11-29 01:38 AM)
|
Top
|
|
|
|
#130280 - 2004-12-01 02:46 AM
Re: Passing Info From Kixtart to NT Shell
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4557
Loc: USA
|
I may be a bit late to this discussion and I agree with the others suggestions to change this to Kix only, but there is another way to pass info to the cmd shell from Kix...
First create your kix script. Below is my simple example.
csd.kix Code:
$=setoption("ASCII","on") @csd
Then add the following to your cmd script to set a variable to the output of the kix script.
Code:
@echo off set csd= for /f "tokens=*" %%i in ('kix32 csd.kix') do set csd=%%i echo %csd%
To modify this to work with other kix scripts, you must prepend the line "$=setoption("ASCII","on")" to your kix script so that the script outputs ASCII characters to the console. And as another suggestion, only display one line of output per script.
Then its just a matter of modifying your cmd script to include the name of the kix script and the name of the variable you want to define.
|
Top
|
|
|
|
#130281 - 2004-12-01 03:28 AM
Re: Passing Info From Kixtart to NT Shell
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4557
Loc: USA
|
If you need to make this variable available to the system or other cmd shells, then you will have to use SETENV.
Code:
@echo off for /f "tokens=*" %%i in ('kix32 csd.kix') do setenv -m csd "%%i"
|
Top
|
|
|
|
#130282 - 2004-12-01 05:45 PM
Re: Passing Info From Kixtart to NT Shell
|
drum15
Fresh Scripter
Registered: 2003-11-26
Posts: 5
Loc: Glasgow, Scotland, UK
|
Al_po
Thanks for this. I will give it whirl and see what I get.
|
Top
|
|
|
|
#130286 - 2004-12-02 02:28 AM
Re: Passing Info From Kixtart to NT Shell
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4557
Loc: USA
|
okay... now I understand...
Well it would be a two step process if you want the var available at the time of the script, and left over for other shells...
Code:
for /f "tokens=*" %%i in ('kix32 csd.kix') do set csd=%%i echo %csd% setenv -m csd "%csd%"
give it a shot... it works
|
Top
|
|
|
|
#130287 - 2004-12-02 10:16 AM
Re: Passing Info From Kixtart to NT Shell
|
drum15
Fresh Scripter
Registered: 2003-11-26
Posts: 5
Loc: Glasgow, Scotland, UK
|
Al_Po
Tried a small test script just like you suggested and played about with values and it seems to work a treat! So thanks for that.
Now just need to go and play with the real scripts....
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 558 anonymous users online.
|
|
|