Kan iemand mij vertellen of onderstaand voorbeeld ook in JScript te realiseren is?
Mijn code tot dusver:
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 ]