Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista General

Vista - Sendkeys problem with Vista

Reply
 
Old 02-17-2007   #1 (permalink)
lcwakeman


 
 

Sendkeys problem with Vista

I am pretty sure that this is a problem with Vista and not I.E. but I have
bni idea where in the Vista forums to post this. The following code works in
XP with IE 6 and IE 7:

function playFile(player, file)
{
var WshShell = new ActiveXObject("WScript.Shell");
if (WshShell.AppActivate("Windows Media Player")) {
WshShell.SendKeys('%FO');
WshShell.SendKeys(file);
WshShell.SendKeys('{ENTER}');
} else {
WshShell.Run('"'+player+'" "'+file+'"');
}
}

It is called by passing in the fully specified (C:\...) location of the
WIndows Media Player and an mp3 file that I want it to play. When the Media
Player isn't running, it is started and the file plays. If the Media Player
is running, it can't open the file. After some examination, the File Open
Dialog box is dropping the first characters of the file name (as in the C)
and
of course, WMP can't open ":/...". ANy Ideas?

I am actually using another program that doesn't work by associating a file
type. It always starts a new instance of the program. I tried it with WMP
to see if the issue was with the program I use and it fails the same way.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Strange Sendkeys() problem PowerShell
Using sendkeys in a web form VB Script
sendkeys, ie7, forms, any new bugs? VB Script
SendKeys to cmd.exe PowerShell
SendKeys.SendWait don't work in Vista Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46