Page 1 of 1 1
Topic Options
#211240 - 2016-03-28 09:17 PM Have kixtart call .vbs file and do something with the output
ardy8888 Offline
Fresh Scripter

Registered: 2016-03-28
Posts: 9
Loc: New York
I've got a .vbs file that exits with specific numeric codes depending on what the .vbs finds. How can I have kixtart see this output and do something with it?

Here is a snipet of the the .vbs where it exits with code:

If InStr(response, "Non-Enrolled User") Then
result = 12
ElseIf InStr(response, "Enrolled User") Then
result = 47
End If
wscript.quit result

And here is a snipet from kixtart where I'm trying to do something based on the .vbs output:

if ingroup ("CheckEnroll")
SHELL "START /W C:\scripts\CheckEnroll.vbs"
if @ERROR = 12
$smtpto=inputbox("Would you like more information?","Enrollment")
MAILER($smtpto)
endif
endif

If I run the kixtart and print @ERROR, it returns the number 2. Maybe I'm misunderstanding @ERROR, but I'm expecting it to be either 12 or 47. Insights? Thanks in advance!!

Top
#211241 - 2016-03-28 10:38 PM Re: Have kixtart call .vbs file and do something with the output [Re: ardy8888]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4372
Loc: New Jersey
Welcome to KORG!

ERROR 2 is "file not found", so likely Kix isn't finding your VBS script.

Also - "start" runs in a separate shell, so the result may not be passed back.

When I write
 Code:
Shell 'cscript //nologo C:\temp\tst.vbs'
@ERROR ?
and the tst.vbs contains
 Code:
result = 47
wscript.quit result
, Kix reports @ERROR of 47, as desired.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#211245 - 2016-03-29 10:41 PM Re: Have kixtart call .vbs file and do something with the output [Re: Glenn Barnas]
ardy8888 Offline
Fresh Scripter

Registered: 2016-03-28
Posts: 9
Loc: New York
Thanks so much!! That worked perfectly!!
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 229 anonymous users online.
Newest Members
SHEBLU_HOSSAIN, JohnShearer, sam_white, Luuraap, mve666
17800 Registered Users

Generated in 0.052 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org