Page 2 of 2 <12
Topic Options
#155917 - 2006-01-27 10:16 AM Re: Translate it to KIX?
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
You could use the sleep command and wkix so user don't see the console but are paused until the given sleep time is done, you could use the task scheduler, you could use a loop until for example @time is the same or higher as what you want. There are lots of ways to put this in a script.

One warning is in place imho. If you run your scripts synchronized nothing will happen until the script is told to continue by some sort of timer. User will not be able to do anything until the script is done.

When you use the task scheduler or run your login script not synchronized you will avoid this situation.


Edited by Mart (2006-01-27 10:16 AM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#155918 - 2006-01-27 11:28 AM Re: Translate it to KIX?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
actually, this script runs a script, and then sleeps a minute and then again runs the batch and never stops!
Code:

i = true;
while (i)
}
...
WScript.Sleep(59000);
}



yep, the i never gets resetted.
your current scripts runs forever with 1 minute sleeps.
and every minute calls a bat.
is that what you are after?
_________________________
!

download KiXnet

Top
#155919 - 2006-02-02 03:19 AM Re: Translate it to KIX?
kingfisher Offline
Fresh Scripter

Registered: 2005-12-28
Posts: 28
To Mart: Do you mean my script can not been transferred to Kix?

To Jooel:You got it.And is there a kix sentence to run the "*.wsf", I tried many times, but failed.

Top
#155920 - 2006-02-02 09:19 AM Re: Translate it to KIX?
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
I suppose it can be translated to kix but like said I'm blind in the JavaScript world so I’m unable to help you with it.

If it does a "sleep" until a certain time is reached then it’s fairly easy to translate to kix with it’s build in command/functions and macro’s.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#155921 - 2006-02-02 10:28 AM Re: Translate it to KIX?
kingfisher Offline
Fresh Scripter

Registered: 2005-12-28
Posts: 28
Mark, if using kix32,is it possible to hide the console and it just stays at background? Sorry for my weak question, I am a stranger:(.
Top
#155922 - 2006-02-02 10:31 AM Re: Translate it to KIX?
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
To hide to console you should use wkix. Kix32 can hide the console but wkix is build to be without a console.

If you cant use wkix then this code will hide the console.

Code:

SetConsole ("HIDE")



Edited by Mart (2006-02-02 04:14 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#155923 - 2006-02-02 03:49 PM Re: Translate it to KIX?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
no, it will not show.
_________________________
!

download KiXnet

Top
#155924 - 2006-02-02 04:15 PM Re: Translate it to KIX?
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Sorry. You're right.
Edited the post above.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#155925 - 2006-02-04 08:39 AM Re: Translate it to KIX?
kingfisher Offline
Fresh Scripter

Registered: 2005-12-28
Posts: 28
I have such a code:
Code:
 
;The scheduled time, it also can be replaced with a random time
$AuditTime="14:30:00"
;The time user logon on PC
$CurrentTime=@Time
;Getting the detail number to determine how many seconds script will sleep
$Hours=Cint(SubStr($AuditTime,1,2))-Cint(SubStr($CurrentTime,1,2))
$Minutes=Cint(SubStr($AuditTime,4,2))-Cint(SubStr($CurrentTime,4,2))
$Seconds=Cint(SubStr($AuditTime,7,2))-Cint(SubStr($CurrentTime,7,2))
;Work out how many seconds
$SleepTime=$Hours*3600+$Minutes*60+$Seconds
;Run a program
Run "Notepad.exe"



I set it as logon script, and as Mart said, I use wkix32.exe, I don't know why the command line displays still and waits for the time coming. But if I just run the script, the command line didnot be shown and wkix32 stayed at background. Why? How can I set it to logon script? Is there something I forgot to do?

Thanks in advance!

Top
#155926 - 2006-02-04 02:18 PM Re: Translate it to KIX?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You don't say how you are calling the logon script, but obviously, that is where your problem is. You have 3 choices.
1. Change how you call your logon script so no DOS box is generated.
2. Disjoin this script from you logon script by RUNning a separate instance of WKiX.
3. Push a call to this script to the RunOnce reg key.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 2 of 2 <12


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

Who's Online
1 registered (Allen) and 675 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.064 seconds in which 0.024 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