Page 1 of 1 1
Topic Options
#211875 - 2016-08-16 01:41 AM Launch VB script with Kix
Gujuu Offline
Just in Town

Registered: 2016-08-16
Posts: 2
Loc: USA
Hello all, i'm trying to figure out what to modify in my kix script to execute a VB file.

Here are the contents of the VB script. Filename logonloop.vbs

On Error Resume Next
Dim winhttp
Set winhttp = CreateObject("WinHttp.WinHttpRequest.5.1")
Do While (True)
' Add the correct host name to the next line
winhttp.Open "GET", "http://smoothwall.test.org:814"
winhttp.SetAutoLogonPolicy(0)
winhttp.Send
WScript.Sleep 120000
Loop


Kix Script:
Gosub Smoothwall
?
:Smoothwall
shell "cscript.exe logonloop.vbs"

Please advise.

Top
#211877 - 2016-08-16 12:53 PM Re: Launch VB script with Kix [Re: Gujuu]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
Welcome first. Second, what are you trying to accomplish? I see an infinite loop with a 33 hour delay built in. Is 0 low or high for autologinpolicy? An aside, not sure why you need the gosub line.
Top
#211880 - 2016-08-16 03:37 PM Re: Launch VB script with Kix [Re: BradV]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
I'm not sure that the Shell command is the right choice here, since that will make the kix script wait until the vb script ends, which in this case is never. Try using Run instead. Also might need the full path to the vb script. Both of the below methods work fine for me.

 Code:
Run 'cscript.exe "' + @ScriptDir + '\test.vbs"'

 Code:
Run 'cscript.exe "C:\users\shane\desktop\test.vbs"'

Top
#211882 - 2016-08-16 06:34 PM Re: Launch VB script with Kix [Re: ShaneEP]
Gujuu Offline
Just in Town

Registered: 2016-08-16
Posts: 2
Loc: USA
Hello Brad, my goal was to use Kix to map all drives and then execute login loop VB script. The Loginloop script was provided by my firewall manufacturer to forward ActiveDirectory login to my Smoothwall via Kerberos. We have network drive mappings & printer mappings on our KIX script. I was told gosub would be a better way of organizing it.

Also, thank you Shane. That did the trick.

Top
#211888 - 2016-08-17 02:46 PM Re: Launch VB script with Kix [Re: Gujuu]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
You shouldn't run the vbs in your login script.

Windows will kill it at some point and until it does, all your xlinets will have kixtart open on the server. It will be a mess that will only work for some time.

You should instead have kixtart copy these files to local path and execute it under hkcu-run-key.

My we filter provider similar script and until I dis the above mentioned change, it never worked right.
_________________________
!

download KiXnet

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