Page 1 of 1 1
Topic Options
#182154 - 2007-11-01 02:03 AM shell vbscript from kix script
jeremyschubert Offline
Getting the hang of it

Registered: 2005-09-17
Posts: 89
I have a kix script that currently uses the line
shell 'wscript \\PDC\netlogon\vbscript.vbs'

I want to replace the path to the script with %logonserver%. Can I pass the kix variable for logonserver to the line? Or doI have to add some vbscript lines to the kix script to make that possible?
Thanks,
Jeremy

Top
#182156 - 2007-11-01 02:25 AM Re: shell vbscript from kix script [Re: jeremyschubert]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Well you should convert whatever the vbscript.vbs is doing into KiXtart so you don't have to hassle with two different scripts.

That aside NT/2000/XP/2003/Vista all support the current environment. Meaning that you don't have to specify as it will look where it is currently (at least for most operations, though since you're pulling an executable from the client and then trying to run from the NETLOGON it might be different.


So in theory all you should need is this:
 Code:
SHELL "wscript vbscript.vbs"



;notice the space after wscript
 Code:
SHELL "wscript " + "%netlogon%\vbscript.vbs"

I think would work.

If not then maybe this one
 Code:
SHELL "wscript " + "%LOGONSERVER%\netlogon\vbscript.vbs"

Top
#182157 - 2007-11-01 02:54 AM Re: shell vbscript from kix script [Re: NTDOC]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
What's "%Netlogon%" ??

Did you mean %LogonServer%? NetLogon isn't defined in any of my environments..

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

Top
#182158 - 2007-11-01 03:32 AM Re: shell vbscript from kix script [Re: NTDOC]
jeremyschubert Offline
Getting the hang of it

Registered: 2005-09-17
Posts: 89
Unfortunately I do need two scripts. The first one is the generic script the downtwon guy makes for all of our schools. And that calls the script for each individual school.
Well you should convert whatever the vbscript.vbs is doing into KiXtart so you don't have to hassle with two different scripts.
I always waffle on kix vs vbscript. Yes, kix scripting takes less lines/words. But then again, I don't have to rely on a third party cmd interpreter (is that what you'd call kix.exe?) to make my script work...
_________________________
---
Bishop Grandin Technology Department
'Either we're on time, or we're late'

Top
#182159 - 2007-11-01 04:38 AM Re: shell vbscript from kix script [Re: jeremyschubert]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Up to you not here to push it down your throat.

But vbscript is still a powerful tool used by spyware and virus writers whereas KiXtart does not have that concern.


Ease of use is KiXtart's main call to glory I think. VBScript is actually more powerful for some things but has a much bigger learning curve and very poor debugging methods.

Hope you get it working whichever way you go.

Top
#182160 - 2007-11-01 04:39 AM Re: shell vbscript from kix script [Re: Glenn Barnas]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
 Originally Posted By: Glenn Barnas
What's "%Netlogon%" ??

Did you mean %LogonServer%? NetLogon isn't defined in any of my environments..

Glenn


If you look at my last code example I show that. I don't have %netlogon% but hey, who knows maybe he does in his environment. \:D

Top
#182161 - 2007-11-01 08:27 AM Re: shell vbscript from kix script [Re: NTDOC]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
 Originally Posted By: NTDOC
If you look at my last code example I show that. I don't have %netlogon% but hey, who knows maybe he does in his environment. \:D


Thats just bad advice :P

You could have just as well said:
$e=CreateObject("KiXtart.RunVbsAsKix").RunScript("vbscript.vbs")
or something to that extent.

Top
#182164 - 2007-11-01 12:22 PM Re: shell vbscript from kix script [Re: Arend_]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
I'm SOOOO confused - you guys have all these cool things that seem to be missing from my environment. \:\(

;\)

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

Top
#182165 - 2007-11-01 12:58 PM Re: shell vbscript from kix script [Re: jeremyschubert]
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
jeremyschubert, although the article the link below references is quite old, I believe that you could benefit from reading it as you build an improved logon script architecture.

Logon script architecture
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#182166 - 2007-11-01 01:06 PM Re: shell vbscript from kix script [Re: jeremyschubert]
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
 Originally Posted By: jeremyschubert
But then again, I don't have to rely on a third party cmd interpreter (is that what you'd call kix.exe?) to make my script work...


I don't see much difference between Ruud's Kix32.exe/Wkix32.exe and Microsoft's Cscript.exe/Wscript.exe, or open source Perl.exe. Scipting is scripting and they all need a compiled program to interpret the script.

The true issues at hand are which scripting tool is best suited for the job and is the code easy enough to be supported in the developer's absence?
_________________________
Home page: http://www.kixhelp.com/hb/

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 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.128 seconds in which 0.068 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