Click to See Complete Forum and Search --> : Start local program
How can i start a local program using javascript or anything else for that matter? I don't mind if a security thing pops up either. The programs that i want to start are NOT in the windows directory, right now i know how to launch programs inside the windows directory (like calc and notepad) but it doesn't work with programs that aren't in the windows directory.
khalidali63
03-26-2003, 04:01 PM
JavaScript can not do that.
look for window specific code like VBScript stuff
Cheers
Khalid
Javascript can launch programs that are in my windows directory, so why not other programs?
I also have some code VBscript but that too can only launch programs from my windows directory, heres the code that i am using for VBscript now:
<head>
<script LANGUAGE="vbscript">
<!--
Dim WshSHell
set WshShell = CreateObject("WScript.Shell")
Sub calc_onclick
WshShell.Run("calc")
End Sub
-->
</script>
</head>
<body>
<a href="#" NAME="calc">Calc</a>
</body>
*bump* can i please get an answer that will help me a little more? I won't se this until i get home at 12:25 so you guys have a little more then 5 hours to answer this.
khaki
03-27-2003, 09:50 AM
you guys have a little more then 5 hours to answer this.that's really very funny
Wow, so far this forum seems to be pretty lame i get one reply so vague that it does nothing for me, and another reply laughing at me for wanting someone to answer my question. So is anyone here nice enough to actually give me an answer that will actually help me?
Accessing programs with JavaScript is possible but all it does is try to download the program to the computer from itself.
Why can it run programs that are in my windows directory then? Like calc and notpad.
It's not JavaScript that is opening the programs in that case. It's more of the WSH. And the WSH is in the Windows folder of the computer, so it only makes sense that it would only open those programs.
Ok, thanks for at least explaining why it won't work to me. I guess i'll start looking for alternative ways to do it then.
Thanks much!
By the way, it may be essential to try something like this. You know how when you click Start --> Run and type in, "notepad" it opens notepad? And the same applies to other programs in the windows folder? Some programs that are install also have command line names. Try using those. Just a suggestion.
Any way to tell what programs have command line names?
Also, what would happen if a put a progam in the windows folder that when opened launched another program not inside the windows folder? I'm guessing there would be registry settings to add so windows could find the program but they wouldn't be that hard to find for me probably.
You could try that. Try just clicking Run and typing on the name of the program. For example: photoshop. Just try a bunch of stuff like that. That's all I can say.
OK, i found the registry key i need to add to make it open programs from the run dialog which is a good start :)
Now to add a few progrrams and test it, i hate editing the registry though because you need to restart after each change :(
OK, i can now run whatever i want from the run dialog, but they don't run maximized. Do any of you have an idea of what to do? The lines that i am using look exactly the same as the ones for notepad because i just exported the notepad ones and then edited them.
Oh well thanks for helping me get this far, now the programs that i want will run with that VBScript i posted earlier. All i have to do is find a way to get them to run maximized which shouldn't take me too long.
Is the file extension for a shortcut .lnk or ink in winXP?
I AM THE WINNAR! :P i got it to work! :) i just made a shortcut to the program that is set to run in fullscreen and added all (there are 3 of them) the keys for that in the registry and now it works fine, now i've just got about 10 - 15 more programs to add to my run dialog.
btw the extension for a shortcut is .lnk (l as in link), i just tried them both
Ice3T
03-30-2003, 02:25 PM
can I use that vb script to add to a html document to run a prog located here
file:///C:/Program%20Files/ABC/prog.exe
If so please show me the script I dont know vbscripting
thanks
You will need to add a bunch of things to the registry, are you any good with the registry? After you finish that its quite easy to do.
Ice3T
03-31-2003, 07:55 AM
I know nothing about the registery, if not that it registers the programs you install.
NeedAJob
03-03-2004, 12:06 PM
Although what you've said is true, all you need to do to be able to open applications on the Run bar is edit your path variables.
For example to open up Word, right-click "My Computer"->Properties->Advanced Tab->Press Environment Variables
In the System Variables list, select PATH, on the end of the variable value box add:
;C:\Program Files\Office\
Some operating systems you will need a restart before it works.
Then open the "Run" dialog and type in word9 (or whatever) and it will open.
HTH