Erwin01 0 Posted October 14, 2005 Report Share Posted October 14, 2005 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 Quote Link to post Share on other sites
Jonas 151 Posted October 14, 2005 Report Share Posted October 14, 2005 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<{POST_SNAPBACK}> You want them to open something from your hard-drive? Quote Link to post Share on other sites
Erwin01 0 Posted October 15, 2005 Author Report Share Posted October 15, 2005 yea, that's right.... what?? not possible??--- by the way, (now I see I'm in "browser scripting"...) it will be a file for myself, just on my local computer.... Quote Link to post Share on other sites
Webworldx 0 Posted October 15, 2005 Report Share Posted October 15, 2005 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" Quote Link to post Share on other sites
Erwin01 0 Posted October 15, 2005 Author Report Share Posted October 15, 2005 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" <{POST_SNAPBACK}> 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 Quote Link to post Share on other sites
Webworldx 0 Posted October 15, 2005 Report Share Posted October 15, 2005 Copy it again from my post and hopefully it shouldn't get that error. You could indeed put it between yourIf choice = vbYes Then ....End If Quote Link to post Share on other sites
Erwin01 0 Posted October 15, 2005 Author Report Share Posted October 15, 2005 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.RunOK, I've got it right now , thank you all very much !!! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.