[JScript] WScript.sleep()

Pagina: 1
Acties:
  • 70 views sinds 30-01-2008

Acties:
  • 0 Henk 'm!

Verwijderd

Topicstarter
Kan iemand mij vertellen of onderstaand voorbeeld ook in JScript te realiseren is?

VBScript:
1
2
3
4
5
6
7
8
9
10
11
12
Dim wshell, proc
set wshell = server.createobject("wscript.shell")
set proc = wshell.exec("main.cmd")

'Wait the process to finish
Do While proc.Status = 0

    WScript.Sleep 100

Loop

set wshell = nothing

Mijn code tot dusver:

code:
1
2
3
4
5
6
7
8
var oWShell = new ActiveXObject("WScript.shell");
var oHandle = oWShell.exec("main.cmd");

//Wait the process to finish
while (oHandle.Status == 0)
{
    WScript.sleep(100); //Hier krijg ik de melding: 'WScript' is undefined
}

[ Voor 7% gewijzigd door Verwijderd op 12-08-2005 15:36 ]


Acties:
  • 0 Henk 'm!

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 09-09 13:58

NMe

Quia Ego Sic Dico.

[google=jscript sleep]
Kortom: ik zie in dit topic te weinig eigen inzet van je terug, en daarom doe ik het op slot. Lees ook P&W FAQ - De "quickstart" nog eens. Bovendien hoort JScript in Webdesign & Graphics. :)

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


Acties:
  • 0 Henk 'm!

  • Creepy
  • Registratie: Juni 2001
  • Laatst online: 07:55

Creepy

Tactical Espionage Splatterer

Je maakt een oWShell aan, dus die zal je ook aan moeten spreken i.p.v. WScript. WScript heb je niet gedefinieerd dus deze bestaat ook niet.

Mocht je er met mijn tip nog niet uitkomen dan geeft google nog ladingen bruikbare links: http://www.google.nl/sear...=nl&q=jscript+sleep&meta=

Lees AUB P&W FAQ - De "quickstart" eens door. We verwachten hier van je dat je zelf eerst actief opzoek gaat naar een oplossing. Iets wat je zo te zien niet gedaan hebt want googlen op "jscript sleep" geeft al bruikbare voorbeelden terug.

* Creepy aait NMe

"I had a problem, I solved it with regular expressions. Now I have two problems". That's shows a lack of appreciation for regular expressions: "I know have _star_ problems" --Kevlin Henney


Dit topic is gesloten.