|
-
Aug 18th, 2008, 12:50 PM
#1
Thread Starter
New Member
VB to control WME auto restart - Help Please
Hello, I would like some help with the following,
I am trying to auto start 3 different WME live streams using .bat and .VB files.
Here is how I have this set up so far.
IN Startup IN am starting startencoding.bat
This contains :
-----------------
call startencoding1.bat
call startencoding2.bat
call startencoding3.bat
------------------
These 3 .bat files contain this each with a different .wme file name to launch:
------------------
START /min C:\FDBR.wme
dir c:\ /s > nul
dir c:\ /s > nul
dir c:\ /s > nul
wscript.exe C:\reconnect.vbs
---------------
This calls the reconnect.vbs
----------------
On Error Resume next
Set EncoderAgent = CreateObject("WMEncAgt.WMEncoderAgent", "127.0.0.1")
Set Encoder = EncoderAgent.GetEncoder(EncoderAgent.EncoderNamesCollection.Item(0))
'WMENC_ENCODER_STARTING = 1
'WMENC_ENCODER_RUNNING = 2
'WMENC_ENCODER_PAUSED = 3
'WMENC_ENCODER_STOPPING = 4
'WMENC_ENCODER_STOPPED = 5
'WMENC_ENCODER_END_PREPROCESS = 6
While 1=1
Select Case Encoder.RunState
Case 5
WScript.Sleep 5000
Encoder.Start
End Select
WScript.Sleep 1800
Err.Clear
Wend
--------------------
When I run this, it brings up all 3 WME live programs. The first instance of the WME program works fine, when you click on the stop, it auto restarts. When you click stop on the other 2, the vb script does not seem to be working, and does not restart it.
So my question, what is the Best way to set this up to get all 3 .vb scripts to work, or different instances?
I have already tried 3 different named reconnect.vbs's and this did not work :-(
Any suggestions would be Greatly Appreciated!
Regards
David
-
Aug 18th, 2008, 01:35 PM
#2
Re: VB to control WME auto restart - Help Please
Welcome to the forums. 
Step One remove the On Error Resume Next line and by in large forget that it even exists.
You do not want to ignore errors!!!!!!!!!!!!!!!!!! You want errors to happen while you are coding so you can take steps to fix them.
There is probably something going on in your code that you are not seeing because of this statement. If you are getting an error, then you (and we) need to know what it is so it can be dealt with.
-
Aug 18th, 2008, 02:18 PM
#3
Thread Starter
New Member
Re: VB to control WME auto restart - Help Please
Hi, Thanks for your help so far!
I removed the error code and re ran the script.
Ok, here is what happens, The script runs, bat files opens, runs the .vb.
The first WME encoders opens and starts encoding, The other 2 WME encoders open and do not start encoding. I can stop the first one, and it auto restarts the encoder again, as it in meant to. The other 2 do not strat, can start manually, then stop them, but do not restart.
I checked the error logs in XP for apps and system and do not see any kind of errors.
I have to let you now, I Dl'd the .vb script, and it is working with my bat file. I am not a programmer though, so I do not know how to mod this file to get it to work with all three sessions.
So what should I try next?
Regards
David
-
Aug 19th, 2008, 08:43 AM
#4
Thread Starter
New Member
Re: VB to control WME auto restart - Help Please
Hi, is there anyone that can help? Please.
-
Aug 20th, 2008, 08:48 AM
#5
Thread Starter
New Member
Re: VB to control WME auto restart - Help Please
anyone? At this time I am ready to send some money to some ones PayPal to help me with this!!!
-
Aug 23rd, 2008, 02:25 PM
#6
Thread Starter
New Member
Re: VB to control WME auto restart - Help Please
-
Aug 23rd, 2008, 09:21 PM
#7
Hyperactive Member
Re: VB to control WME auto restart - Help Please
Instead of using the Call command in the batch file, why not try the Start command?
Call will break off and run a batch file a bit like a sub routine, while start (unless told to wait with a command line switch) will just run something as an instance.
-
Aug 26th, 2008, 09:15 PM
#8
Thread Starter
New Member
Re: VB to control WME auto restart - Help Please
Hi I changed this to Start from Call. This now opens 3 separate dos windows, opens all the windows media encoders. But for some reason it only starts the first one, but not the second and third version :-(
ANY help would be appreciated on this! Willing to send someone some money to their Paypal account to get this completed ASAP..
 Originally Posted by Quiver318
Instead of using the Call command in the batch file, why not try the Start command?
Call will break off and run a batch file a bit like a sub routine, while start (unless told to wait with a command line switch) will just run something as an instance.
-
Sep 3rd, 2008, 10:22 PM
#9
Thread Starter
New Member
Re: VB to control WME auto restart - Help Please
HI, can I get ANY help on this, will pay!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|