Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Wscript.Shell open file in wmplayer
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Al Dunbar  
View profile  
 More options Nov 1 2009, 5:29 pm
Newsgroups: microsoft.public.scripting.vbscript
From: "Al Dunbar" <aland...@hotmail.com>
Date: Sun, 1 Nov 2009 10:29:32 -0700
Local: Sun, Nov 1 2009 5:29 pm
Subject: Re: Wscript.Shell open file in wmplayer

"cdubone" <gu...@unknown-email.com> wrote in message

news:09b40379df88c25c91573f85a8d01528@nntp-gateway.com...

> I'm making an app that lives on a CD that opens wmv's from the CD. I
> thought everything was going well until I realized that if wmplayer
> isn't the default player the thing crashes. I have no idea why this is
> (I'm a Web dev and I'm totally out of my league here). Anyway, I'm
> trying to get around this by forcing wmplayer to open. Here's my code:

> Sub OpenFile (theFile)
> Set objShell = CreateObject("Wscript.Shell")
> objShell.Run "assets\" & theFile
> '            objShell.Run "wmplayer.exe D:assets\TheFile.wmv"

I know that is a comment, however, it is of concern that "D:" is not
followed immediately by a "\". Similarly, the "D:" itself would not allow
for this to work in a computer having two hard drives, or two CD drives.

> End Sub

> This works: objShell.Run "assets\" & theFile

> And if I hard code a file reference it works:
> objShell.Run "wmplayer.exe D:assets\TheFile.wmv"

Again, you really should use more explicit paths that will always be correct
rather than relying on the path including the desired executable, and the
"D:" drive containing the CD.

> I'm essentially trying to fuse those two lines of code - open 'theFile'
> in the assets directory via a relative path (not absolute) in wmplayer.
> I've tried so many ways to get this going but can't seem to find the one
> that works.

> Will someone show me how this is done?

You might include a copy of wmplayer.exe on the CD, assuming that running
this will not modify the user's related settings on the workstation. Or you
might do a search for wmplayer.exe on the hard drive, as it may not be
located in the same place on all systems.

/Al


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google