Re: open any file with vbscript ?
- From: mr_unreliable <kindlyReplyToNewsgroup@xxxxxxxxxxx>
- Date: Wed, 21 Dec 2005 17:49:21 -0500
hi Jean-Marie,
Yes, you can use wshShell.Run for that.
--- <quote> ---
If a file type has been properly registered to a particular program, calling run on a file of that type executes the program.
--- </quote> ---
In other words, oShell.Run the FILE NAME, (rather than the app), and the "run" method will automagically call the appropriate app for the file.
Caveat Emptor: "run" can't read minds. You must have properly associated the file extension with the app in the registry for this to work.
cheers, jw ____________________________________________________________
You got questions? WE GOT ANSWERS!!! ..(but, no guarantee the answers will be applicable to the questions)
jm.almeras wrote:
Dear vbscript experts, Is it possible with vbscript to open a file no knowing which application it corresponds to ? For example, if extension is xls it should start Excel, if extension is psd it should open photoshop, etc. Thank you ! Jean-Marie
.
- References:
- open any file with vbscript ?
- From: jm.almeras
- open any file with vbscript ?
- Prev by Date: Re: Uptime
- Next by Date: vbScript to detect DC
- Previous by thread: open any file with vbscript ?
- Next by thread: vbScript to detect DC
- Index(es):
Relevant Pages
|
Loading