Jump to content

How To Open a .avi-file with VBScript??


Recommended Posts

hey you code-masters :)I've got a little vbscript excisting 1 from (Yes and No)I would like when Users click on vbYes a .avi file gets opened...for example the path is E:\Video\test.avican sombody help me?thnksErwin de Brouwer

You want them to open something from your hard-drive? :)
Link to post
Share on other sites

Could always do it using wScript.shell?

OPTION EXPLICIT dim wins, yourprog, yourfileSet wins = WScript.CreateObject("WScript.Shell")yourprog = "C:\Program Files\Windows Media Player\wmplayer.exe"yourfile = CHR(34) & "C:\Windows\Desktop\YOURFILE.avi" & CHR(34)'You need to quote the file you're putting in, as you would in'start, run.. so the chr(34) does that (double-quote)wins.Run CHR(34) & yourprog & CHR(34) & yourfile, 0, "FALSE"

Link to post
Share on other sites
OPTION EXPLICIT dim wins, yourprog, yourfileSet wins = WScript.CreateObject("WScript.Shell")yourprog = "C:\Program Files\Windows Media Player\wmplayer.exe"yourfile = CHR(34) & "C:\Windows\Desktop\YOURFILE.avi" & CHR(34)'You need to quote the file you're putting in, as you would in'start, run.. so the chr(34) does that (double-quote)ws.Run CHR(34) & yourprog & CHR(34) & yourfile, 0, "FALSE"

thnx, but where should I paste this into my vbsript? After the part wich is:

if choice = vbYes Then....

thank you for helping me... :)--- by the way... when I paste it like this in a new VBScript, there is a Runtimerror on line 12, 1st caracter: ws.Run

Link to post
Share on other sites
thnx, but where should I paste this into my vbsript? After the part wich is: thank you for helping me... :)--- by the way... when I paste it like this in a new VBScript, there is a Runtimerror on line 12, 1st caracter: ws.Run
OK, I've got it right now , thank you all very much !!! :)
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...