Page 1 of 2 12>
Topic Options
#102744 - 2003-07-11 08:44 AM Running a command from kix...
RichardG_dup1 Offline
Fresh Scripter

Registered: 2003-07-11
Posts: 16
Loc: Melbourne, Australia
OK, I have read all about the Shell vs Run command but I have another question.

I am running a script during logon which needs to run a batch file. I want the script to continue when the batch file is executed.

My problem is... The batch file takes a while to complete and even though I'm "run"ning the batch file from the kix script it still pauses at the end waiting for the batch file to finish.

Is there a way to kick off a batch file and forget about it?

Thanks

Rich.

Top
#102745 - 2003-07-11 09:05 AM Re: Running a command from kix...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
how are you running it?
run never stops to wait longer than what the loading takes.
how are you calling the batch?
do you use the %comspec%?
_________________________
!

download KiXnet

Top
#102746 - 2003-07-11 09:11 AM Re: Running a command from kix...
RichardG_dup1 Offline
Fresh Scripter

Registered: 2003-07-11
Posts: 16
Loc: Melbourne, Australia
Yeah you are right, the script does not stop until it reaches the end when I assume it sits there waiting for the batch file I called finishes... (I am calling the batch file early in the script)

I have tried %COMSPEC% as well as just running the batch file.

Thanks for listening Lonkero

Top
#102747 - 2003-07-11 09:16 AM Re: Running a command from kix...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so, it's not the run at all.
you indeed should use the comspec to fire batches to make sure they work on all wksta's.

anyway, if you want to kick the batch and want to let it stay alive after kix is finished, try something like:
code:
 
"%comspec% /c start mybatch.bat"

but it could be better to just remove your batch and do it's job otherwise.
_________________________
!

download KiXnet

Top
#102748 - 2003-07-11 09:17 AM Re: Running a command from kix...
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Welcome to the board Richard

hmmm... I'm actually having the same results with a BATCH file.

SCRIPT
run '%COMSPEC% /C C:\temp\test.bat'
? 'All done, cya'
EXIT 1

BATCH
@echo off
copy C:\Backup\*.* c:\eraseme
exit

Also tried this for script.

run 'C:\temp\test.bat'
? 'All done, cya'
EXIT 1

But same results, the Dos prompt does not return until I press the enter key. I tried creating a shortcut as well and then tried to run the shortcut, but that did not work either.

Still testing, checking.

I'm using KiXtart v4.21 on Windows 2000 SP4
KIX32.EXE

Top
#102749 - 2003-07-11 09:18 AM Re: Running a command from kix...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
weird.
_________________________
!

download KiXnet

Top
#102750 - 2003-07-11 09:22 AM Re: Running a command from kix...
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
The batch file if run alone in DOS windows exits properly. Not sure why KiX is not releasing it.
Top
#102751 - 2003-07-11 09:27 AM Re: Running a command from kix...
RichardG_dup1 Offline
Fresh Scripter

Registered: 2003-07-11
Posts: 16
Loc: Melbourne, Australia
Just played around with the START option with no success. I know in VB if you "shell" it runs without waiting, I wonder if I could just run a vbs to do the job...

Problem is I'm in a ...very... mixed enviro

Top
#102752 - 2003-07-11 09:29 AM Re: Running a command from kix...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
heh, richard.
you could always use wkix32.exe for this.
and maybe even runex() from our udflib [Wink]
it does not use kixtart run at all but uses system to fire the batch.
_________________________
!

download KiXnet

Top
#102753 - 2003-07-11 09:30 AM Re: Running a command from kix...
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Richard,

Not sure what has happened to KiX32.exe but WKIX32.EXE will finish when the batch has completed.

I guess we'll need to raise this issue with the author Ruud and see what he has to say.

For now if you can, try running WKIX32.EXE

Also, how big is this batch? KiX can do most of this stuff natively.

Top
#102754 - 2003-07-11 09:35 AM Re: Running a command from kix...
RichardG_dup1 Offline
Fresh Scripter

Registered: 2003-07-11
Posts: 16
Loc: Melbourne, Australia
Thanks for the help guys.

I started off with a kix script to do the job but couldn't work out how to set it going without kix waiting for it, hence why I thought a batch file would be easier.

I have never played with wkix32 what is the diff? And is it support from 9x?

R

Top
#102755 - 2003-07-11 09:39 AM Re: Running a command from kix...
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
WKIX32.EXE does not produce a console, and yes it should work just fine on Windows 9x

Why don't you explain/show us what it is you're wanting to do and I'm sure if it is not TOO large of a task we can easily help get you going in the right direction.

Top
#102756 - 2003-07-11 09:42 AM Re: Running a command from kix...
RichardG_dup1 Offline
Fresh Scripter

Registered: 2003-07-11
Posts: 16
Loc: Melbourne, Australia
Cheers NTDOC thats a nice offer. Well its simple really:

The main script is the logon script mapping drives, setting time, etc etc (for about 7000 users)

I want to do a dir c:\*.exe /s/b ><servername>\blah$\softwareaudit

which as you can guess can take a wee while. So I thought, why not execute a script that does the DIR in the background after the main script finishes.

Thats it really...

Top
#102757 - 2003-07-11 09:49 AM Re: Running a command from kix...
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hmmm ... was this mentioned before ? Again I am too lazy to read all replies, sorry in advance [Roll Eyes]

But, have you already checked you calling batch for eventual 'pause' statements, or your script for the appearance of get/gets ?

hth
_________________________



Top
#102758 - 2003-07-11 09:52 AM Re: Running a command from kix...
RichardG_dup1 Offline
Fresh Scripter

Registered: 2003-07-11
Posts: 16
Loc: Melbourne, Australia
Hi Jochen,

Yep no pause or get commands to be seen...

On a different note, I converted my test script to use WKIX32.EXE and now the script hangs at the end, does not even seem to call my batch file.

Hmm its getting late here, maybe thats why [Wink]

Top
#102759 - 2003-07-11 09:58 AM Re: Running a command from kix...
RichardG_dup1 Offline
Fresh Scripter

Registered: 2003-07-11
Posts: 16
Loc: Melbourne, Australia
Here are the actual details:

Line in script:
Run "%COMSPEC% /C C:\SOFTWARE.BAT " + @WKSTA

Batch file SOFTWARE.BAT
@ECHO OFF
DIR C:\*.EXE /B/S >\\CORPSUPPORT\RAW$\SOFTWARE\%1.txt

Top
#102760 - 2003-07-11 09:59 AM Re: Running a command from kix...
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
We can get you all the installed APPS much faster. Does not include all .exe files, but for the most part you get 90% or more of everything that has been installed on the OS.

Let me know if that is good enough and I'll dig up the link or script for you.

Top
#102761 - 2003-07-11 10:01 AM Re: Running a command from kix...
RichardG_dup1 Offline
Fresh Scripter

Registered: 2003-07-11
Posts: 16
Loc: Melbourne, Australia
I assume you are talking WMI?
Top
#102762 - 2003-07-11 10:02 AM Re: Running a command from kix...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
richard, you indeed could use wkix.
the benefit of not even having the console window at all (like my logonscript) thus it runs totally on background.

and these tasks can be then done at the same time user is being logged in and he can even start doing the work before the script finishes.

I have found this really powerfull specially with software upgrades like off97->off2k or IE upgrades.

anyway, like said, this might be worthwhile topic to discuss with ruud.
we have already asked many changes to the way kix does run and shell.
_________________________
!

download KiXnet

Top
#102763 - 2003-07-11 10:05 AM Re: Running a command from kix...
RichardG_dup1 Offline
Fresh Scripter

Registered: 2003-07-11
Posts: 16
Loc: Melbourne, Australia
Thanks for everyones advice, I'll keep looking and let you know.

R

Top
Page 1 of 2 12>


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 883 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.079 seconds in which 0.031 seconds were spent on a total of 12 queries. Zlib compression enabled.

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