1.

Solve : Command prompt to operate functions inside of other programs?

Answer»

I'm trying to write a program through notepad that will play a video through windows movie player and at the same time record the person watching the video through my webcam. It seems simple in concept but in reality its proving to be impossible. i have read countless forums and different websites but none of them seem to cover my topic. this is how far i have gotten


{
start/max lws /quickcapture

start/max wmplayer "C:\Documents and Settings\Joe\My Documents\My Videos\LOGITECH Webcam\video 4.wmv" /fullscreen
pause
}

lws is my logitech webcam but now that i got it to open i dont know how to run the start and stop RECORDING functions
failed attempts
/record
/startrecording
/start capturing
/capture
and many more variations.
Does anyone know how to accomplish accesing functions inside of other programs through the command prompt?
please help
thanks Joe
Why the curly brackets? Have you studied batch syntax at all? What webcam software are you using?

Does your webcam software have a key combonation to start the capture?1)Curly brackets aren't used in my code just in the explanation.

2)i am self taught through the c++ training web site this web site and about a dozen OTHERS.(clearly im not educated on the subject)

3)The webcam software im using is "logitech Webcam C200" but i'm hoping for a simple command that if i change webcams in the future i can just change that line of code.

4)I looked under all the help web sites and even called logitech to get a short key or key combination to start capturing or recording but they were not helpful. (there may be i just cant find where that might be written)

i appreciate your help and responses in advance thank you
Ok i found the keys to start and stop recording ......the letter v and s were underlined so it is ALT+V to start recording and ALT +S to stop recording.


How do i enter those commands (also with a time delay) into the command prompt using windows xp notepad?Type this into notepad and save as .vbs:

Code: [Select]Dim wsh
Set wsh = CreateObject("wscript.shell")
wsh.Run "lws /quickcapture", 3, false
wsh.Run "wmplayer C:\Documents and Settings\Joe\My Documents\My Videos\Logitech Webcam\video 4.wmv /fullscreen", 3, false
wscript.sleep 5000
wsh.sendkeys "(%v)"
wscript.sleep [insert length of vid in miliseconds]
wsh.sendkeys "(%s)"
Set wsh = Nothing
A few changes:
Code: [Select]Dim wsh
Set wsh = CreateObject("wscript.shell")
wsh.Run "lws /quickcapture", 3, false
wscript.sleep 3000
wsh.sendkeys "%v"
wsh.Run "wmplayer C:\Documents and Settings\Joe\My Documents\My Videos\Logitech Webcam\video 4.wmv /fullscreen", 3, true
wscript.sleep 2000
wsh.sendkeys "%s"
Set wsh = Nothing
Ok looks good but im running into problems. im gonna run some variations first before i ask the next questions but the script does NOT know which screen to access to send the keys.

also for my education im curious why the lines

, 3, false
, 3, true


are needed and what they do?Ok i tried a number of different things and i cannot direct the send keys command to the proper window.

also i changed the code and made 1 .bat file and 1 .vbs file

the code "hope.vbs" reads as follows


Dim wsh
Set wsh = CreateObject("wscript.shell")
wsh.Run "lws /quickcapture"
wscript.sleep 3000
wsh.sendkeys "%v"
wscript.sleep 10000
wsh.sendkeys "%s"
Set wsh = Nothing


and the code "final1.bat" reads as follows




start/max wmplayer "C:\Documents and Settings\Joe\My Documents\My Videos\Logitech Webcam\video 4.wmv" /fullscreen

start/max hope.vbs


pause



So my current question is how do i direct the sendkeys to the proper window? At the moment i need to click on the proper window and then it will work properly but its currently pressing the keys in the mydocuments folder.

note: if there is a setting to bring this window on top of all others i can NOT use it because the webcam has got to run hidden underneath wmplayer.

Please advise. thank you
Sorry for the LATE responce. I hope you're still watching this thread.

Quote

note: if there is a setting to bring this window on top of all others i can NOT use it because the webcam has got to run hidden underneath wmplayer.

Yes there is a setting for that. I understand that the webcam has to be run under wmplayer, but why can't you have the webcam start on top and then run wmplayer on top of that. Sure you are probably going to see the webcam start up for a little, but I am afraid that this is the only option.

There is a microsoft article discussing the different window settings here: http://msdn.microsoft.com/en-us/library/d5fk67ky(VS.85).aspx

Quote
also for my education im curious why the lines

, 3, false
, 3, true


are needed and what they do?

The above article should explain that.

Quote
and the code "final1.bat" reads as follows

Forget the bat, you wont need it if your using the vbs.Rrune, why do you want to secretly film people who are watching video clips? I hope there is nothing like a prank or spying or voyeurism going on here.Nahhhh...nuthin like that.Quote from: patio on October 25, 2010, 07:24:13 PM
Nahhhh...nuthin like that.

I asked "why". You did not reply.
HAHA the "why" response wasn't from me .................its for a new invention i got ...........the person will know that they were recorded right after the video plays..................... i got logitech to play video after its finished recording. but if the person knows they are being recorded they will know something is up.................i promise its not for anything unethical or illegal... im gonna read the link you posted and possibly ask another question but thanks for everyones help this far!Yes there is a setting for that. I understand that the webcam has to be run under wmplayer, but why can't you have the webcam start on top and then run wmplayer on top of that. Sure you are probably going to see the webcam start up for a little, but I am afraid that this is the only option.

[/quote]

****I need another option *****

Forget the bat, you wont need it if your using the vbs.
[/quote]

*****the bat opens up the vbs and Wmplayer at the same time i couldnt get it to work using just vbs*****
(lol quoting you didnt work)


Discussion

No Comment Found