Playing audio/video files in Windows 10

Ray Turner
Ray Turner used Ask the Experts™
on
Before Windows 10 an audio/video file could be played from a VB Script using a Shell command.  How do you play an audio/video file from a VB Script with Windows 10?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Bill PrewIT / Software Engineering Consultant
Top Expert 2016

Commented:
I would expect the same thing to work, as long as the extension of the file is recognized as associated with Windows Media Player.

What is the name of the file?

And what is the VBS code you are trying that doesn't work?

~bp
Bill PrewIT / Software Engineering Consultant
Top Expert 2016

Commented:
I just tried it with an MP# file here, that worked fine.

~bp
Ray TurnerSenior Consultant

Author

Commented:
Can you show me the code?
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

IT / Software Engineering Consultant
Top Expert 2016
Commented:
Sure, here is a test script.  It also worked when I used a video file, and changed the file executed to "test.avi".

Set objShell = CreateObject("WScript.Shell")
strCommand = "test.mp3"
objShell.Run strCommand
Set objShell = Nothing

Open in new window

~bp
Ray TurnerSenior Consultant

Author

Commented:
Will this work on Windows 10?
Bill PrewIT / Software Engineering Consultant
Top Expert 2016

Commented:
Yes, that's where I tested it.

~bp
Ray TurnerSenior Consultant

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial