[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Script to open a media file at the scheduled time (Which is a link)

Posted on 2007-07-24
20
Medium Priority
?
357 Views
Last Modified: 2010-08-05
Hi,

At a scheduled time i want to open a media file which is a link on our internet web page.
It should open,Check if sound is full and turn the media player to full size.
Regards
Sharath
0
Comment
Question by:bsharath
  • 9
  • 9
  • 2
20 Comments
 

Expert Comment

by:danlock2
ID: 19565090
as for turning up the volume i have no idea, but you can load it like this.


Copy the below into a notepad file:

@Echo Off
start /max "C:\Program Files\Internet Explorer\iexplore.exe" www.google.com  (change google to the address)
End


save this as something like media.bat.

To set this up to run at a specific time, you have to use the windows task scheduler.  Go to control panel -> Scheduled Tasks.
0
 

Expert Comment

by:danlock2
ID: 19565095
also, you'll have to browse to find your bat file... so make sure you put it in a place where you won't delete it.
0
 
LVL 6

Expert Comment

by:Admin4XP
ID: 19565828
The following script should do all you need. Paste it into a TXT file and rename to Whatever.VBS
then just shedule the file to run for the time you want.

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")

set oshell=createobject("wscript.shell")
oshell.run "sndvol32"
oshell.appactivate "volume control"
WScript.sleep 600
oshell.appactivate "volume control"
oshell.sendkeys "{tab}"
wscript.sleep 100
For X = 1 To 5
    oshell.sendkeys "^{PGUP}"
    oshell.appactivate "volume control"
Next

oshell.sendkeys "{tab}"

oshell.sendkeys "-"
wscript.sleep 100
oshell.appactivate "volume control"
wscript.sleep 100
oshell.sendkeys "%{f4}"

wshshell.run """C:\Program Files\Internet Explorer\iexplore.exe""www.google.co.uk", 3, False
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 11

Author Comment

by:bsharath
ID: 19565942
Its opening but not increasing the Media player volume. Its not opening the full size view
0
 
LVL 6

Expert Comment

by:Admin4XP
ID: 19565974
OK so does the link immidiatly open Media player? whats the link?
0
 
LVL 11

Author Comment

by:bsharath
ID: 19566037
yes it opens the linl.It opens in a ie
0
 
LVL 6

Expert Comment

by:Admin4XP
ID: 19566073
Whats the Web address il try to write it into the Code so it works
0
 
LVL 11

Author Comment

by:bsharath
ID: 19566145
0
 
LVL 6

Expert Comment

by:Admin4XP
ID: 19566201
So when you goto this page Windows Media player is launched with a Video?
0
 
LVL 11

Author Comment

by:bsharath
ID: 19566261
Yes...
0
 
LVL 6

Expert Comment

by:Admin4XP
ID: 19566346
OK try this:

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")


set oshell=createobject("wscript.shell")
oshell.run "sndvol32"
oshell.appactivate "volume control"
WScript.sleep 600
oshell.appactivate "volume control"
oshell.sendkeys "{tab}"
wscript.sleep 100
For X = 1 To 5
      oshell.sendkeys "^{PGUP}"
      oshell.appactivate "volume control"
Next

oshell.sendkeys "{tab}"

oshell.sendkeys "-"
wscript.sleep 100
oshell.appactivate "volume control"
wscript.sleep 100
oshell.sendkeys "%{f4}"

wshshell.run """C:\Program Files\Windows Media Player\wmplayer.exe""http://gate/CONTENT/communicate/RecentEvents/NASSCOM-Mayank/NASSCOM-Mayank.html", 3, false
wscript.sleep 2000
oshell.appactivate "Windows Media Player"
wscript.sleep 300
For X = 1 To 10
      oshell.sendkeys "{F10}"
      oshell.appactivate "Windows Media Player"
Next
0
 
LVL 11

Author Comment

by:bsharath
ID: 19566381
I get this.

Windows Media Player cannot play the file. The Player might not support the file type or might not support the codec that was used to compress the file.
0
 
LVL 11

Author Comment

by:bsharath
ID: 19566393
Volume in mediaplayer also does not increase.
0
 
LVL 6

Expert Comment

by:Admin4XP
ID: 19572486
OK i think its becase the link you gave me is a HTML which launches the media file. I thought it may work but media player needs the link to end in a media extenition i.e wmv or mpg to recognise it.

Could you download the file to a shared network resource and run it from there?
0
 
LVL 11

Author Comment

by:bsharath
ID: 19572573
Ok i saved the file in C:\filename.wmv

Now when i run the script i get this.

Windows Media Player cannot play the file. If the file is on another computer, verify that you are connected to the network. If you typed a path, verify that it is correct. If the problem persists, the server might not be available.

I have windows 2003.Should i upgrade the media player?
0
 
LVL 6

Expert Comment

by:Admin4XP
ID: 19572597
OK have you changed the script it should now look like this:

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")


set oshell=createobject("wscript.shell")
oshell.run "sndvol32"
oshell.appactivate "volume control"
WScript.sleep 600
oshell.appactivate "volume control"
oshell.sendkeys "{tab}"
wscript.sleep 100
For X = 1 To 5
      oshell.sendkeys "^{PGUP}"
      oshell.appactivate "volume control"
Next

oshell.sendkeys "{tab}"

oshell.sendkeys "-"
wscript.sleep 100
oshell.appactivate "volume control"
wscript.sleep 100
oshell.sendkeys "%{f4}"

wshshell.run """C:\Program Files\Windows Media Player\wmplayer.exe""C:\filename.wmv", 3, false
wscript.sleep 2000
oshell.appactivate "Windows Media Player"
wscript.sleep 300
For X = 1 To 10
      oshell.sendkeys "{F10}"
      oshell.appactivate "Windows Media Player"
Next
0
 
LVL 11

Author Comment

by:bsharath
ID: 19572637
Now its opening i have changed the file to a mpg file.Not opening in a full Screen menu
0
 
LVL 6

Accepted Solution

by:
Admin4XP earned 2000 total points
ID: 19572706
OK Try this:

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")


set oshell=createobject("wscript.shell")
oshell.run "sndvol32"
oshell.appactivate "volume control"
WScript.sleep 600
oshell.appactivate "volume control"
oshell.sendkeys "{tab}"
wscript.sleep 100
For X = 1 To 5
      oshell.sendkeys "^{PGUP}"
      oshell.appactivate "volume control"
Next

oshell.sendkeys "{tab}"

oshell.sendkeys "-"
wscript.sleep 100
oshell.appactivate "volume control"
wscript.sleep 100
oshell.sendkeys "%{f4}"

wshshell.run """C:\Program Files\Windows Media Player\wmplayer.exe""C:\filename.wmv", 3, false
wscript.sleep 2000
oshell.appactivate "Windows Media Player"
wscript.sleep 300
For X = 1 To 10
      oshell.sendkeys "{F10}"
      oshell.appactivate "Windows Media Player"
Next
oshell.appactivate "Windows Media Player"
Wscript.sleep 300
oshell.sendkeys "%{ENTER}"

This should send the ALT+Enter shortcut to put windows media player in full screen
0
 
LVL 11

Author Comment

by:bsharath
ID: 19572764
Thanks a lot...
0
 
LVL 6

Expert Comment

by:Admin4XP
ID: 19572817
Glad to help
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip Migration Tip #1 – Source Server Health can be found listed in my profile here: http:…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question