vb script to run other vbscripts in aloop

December 21, 2012 at 02:48:34
Specs: Windows 7
sir

I have a vbscripy code that runs several other .vbs files ie....

Sub RunApplication(ByVal sFile)

Dim WShell : Set WShell = CreateObject("WScript.Shell")
WShell.Run Chr(34) & sFile & Chr(34), 8, false

End Sub


'Executing apps.

RunApplication "E:\Users\joe\Desktop\20_12_2012_project\1.vbs"
RunApplication "E:\Users\joe\Desktop\20_12_2012_project\2.vbs"
RunApplication "E:\Users\joe\Desktop\20_12_2012_project\3.vbs"


the problem is every time i have to start the main script to run these 3 vbs files

can you suggest a code that runs in a loop all the 3 vbs files until i press a key to stop it..


thanx..



See More: vb script to run other vbscripts in aloop

Report •


#1
December 21, 2012 at 15:15:54
I would be interested to see the outcome of this, because I don't know a way to handle this (except the following very ugly method using a batch to call the script:)
::=== f.bat
cscript f.vbs
echo done with the vbscript loop, but still in bat...
::==== end

the vbscript just has a do-loop around your three processes:
do
process-1
process-2
process-3
loop

now the really ugly part, to run:
echo N | f.bat
and to exit from the vbscript loop, use ctrl-C or ctrl-BREAK, which will send you back into the batchfile (with an "No" answer to "terminate batch file y/n")
I think there's a way, I just don't know what it is. Even gwbasic and qbasic had "inkey$", which is what we need here.


Report •

#2
December 22, 2012 at 13:50:19
I could answer, but I'm wondering why he wants to spam three scripts as fast as possible non-stop.

How To Ask Questions The Smart Way


Report •

#3
December 22, 2012 at 16:52:11
Obviously, he wants to break the internet, so it's better that you keep it a secret.

How do you know when a politician is lying? His mouth is moving.


Report •

Related Solutions

#4
December 22, 2012 at 17:39:33
Yes, that is exactly what I'm worried about. Exactly. On the dot. Without question.

How To Ask Questions The Smart Way

EDIT: ↓ ↓ ↓ Yes, yes you were. Exactly. On the dot. Without question. ↓ ↓ ↓


Report •

#5
December 22, 2012 at 19:04:04
I was being sarcastic. I doubt that those are his intentions. He seems to be from India & likes motorcycles. That's all I could find in ten minutes.

Anyway, I would say a batch file would work.

How do you know when a politician is lying? His mouth is moving.


Report •


Ask Question