473,503 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to play a wav file with wmplayer.exe using Shell()

I can get Windows Media Player to start, and play a wav file just fine
using a command line

"C:\Program Files\Windows Media Player\wmplayer.exe" c:\Temp\temp.wav

But I want it to come up from a VB.Net application, so the user will
select the recording he wants and click a button and code will call

Shell("C:\Program Files\Windows Media Player\wmplayer.exe
c:\Temp\temp.wav")

When called from my app, the wav file plays, but the Media Player
window won't come up. From a DOS prompt command line the WMP window
comes up and then plays the file.

I want the users to have the WMP window, not just hear the file.

I looked on MSDN and found a list of command line options, but nothing
in their list does any different.

Any clues?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #1
3 8271
felecha,

Just as your surrounding the path with spaces in it with " " quotes you also
must do this with shell.

Shell(""" & "C:\Program Files\Windows Media Player\wmplayer.exe" & """ &
"c:\Temp\temp.wav")
"felecha" <fe*******@yahoo-dot-com.no-spam.invalid> wrote in message
news:40**********@Usenet.com...
I can get Windows Media Player to start, and play a wav file just fine
using a command line

"C:\Program Files\Windows Media Player\wmplayer.exe" c:\Temp\temp.wav

But I want it to come up from a VB.Net application, so the user will
select the recording he wants and click a button and code will call

Shell("C:\Program Files\Windows Media Player\wmplayer.exe
c:\Temp\temp.wav")

When called from my app, the wav file plays, but the Media Player
window won't come up. From a DOS prompt command line the WMP window
comes up and then plays the file.

I want the users to have the WMP window, not just hear the file.

I looked on MSDN and found a list of command line options, but nothing
in their list does any different.

Any clues?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 20 '05 #2
Well, this is veryinteresting.

I didn't mention in my post that I had tried it both ways already,
with the same result. That is, enclosing the path with the spaces in
it inside quotes (and using "" in VB.Net where I had " in DOS), and
then without.

That was at work. I have Windows XP Pro there. Here I am at home,
with the identical VisualStudio.Net installation, from the very same
Microsoft developer's kit DVD, but I run Windows 2000 Pro at home.

And now I find that both with and without the enclosing quotes, my
VB.Net code DOES bring up the WMP window on the screen and starts
playing the file.

So ... this is a difference in how XP and 2K handle the command from
my app?

I can't see till Iget back to work as to what WMP version is there,
but here I have 9.00.00.3075. The machine at work is an almost new
Dell 8300, with XP right out of the box. I suspect it's also version
9.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #3
Someone just suggested that maybe the issue is a setting in Windows
somewhere, or in WMP, like where you choose an Option "Open WMP
window when called from a VB.Net application."

Any clues?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
7029
by: Patrice FRITSCH | last post by:
I'm trying to run a batch file from an asp page using WScript.Shell object. Dim oWSH set oWSH= Server.CreateObject("WScript.Shell") call oWSH.Run("cmd.exe /c " & szCmd , 0, true) szCmd...
4
47428
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a copy of the access database (creating a backup)...
9
10858
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent...
1
4205
by: Will | last post by:
Hi How do I play a video with c#, I don't need my app to play it, I just wanna my app calling another program (say WMPlayer) and then that program starts playing the video. I just need to see...
5
3612
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
1
3205
by: Terry Olsen | last post by:
I'm working on a file copy component. I'd like to load the "file copy" animation from the shell32.dll and play it (in a picturebox?) while the file is copying. This guy did it here,...
2
1681
by: Glenn Venzke | last post by:
I'm trying to print an Adobe forms file (.fdf) using system.diagnostics.process in a windows service. The problem is, IE is the program that launches that file type & Verb = "Print" doesn't work in...
4
2463
by: Jamey Shuemaker | last post by:
A2k2 with user-level security and all preventive measures, vis a vis, Security FAQ enabled or enacted. I've got three DBs, which due to size constraints can't, or rather, probably shouldn't be...
0
1739
by: srinathava | last post by:
Hi, I am trying to send keystrokes to the NES emulator nester. The idea was to be able to use a standard NES controller whose "state" I can read in using Python and then conveying that to the...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.