Re: open any file with vbscript ?



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


.



Relevant Pages

  • Re: Custom Files?
    ... > Private File Type, then I wouldn't worry about it. ... > Of course not registering it, may mean another app would start using it & ... But regarding the custom ... > | file extension? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Changing file extension
    ... I've seen other apps do this, with seeming impunity, many times. ... extension, but registers the extension to the VB6 app. ... Access shows up in the context menu as an alternate way to open the file type, ...
    (microsoft.public.vb.general.discussion)
  • Re: IE should not open this file type
    ... No need for another file type for the same extension. ... default app for that filetype would do. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: About File "types" and Office 12.1 Service Pack and double-clicking
    ... I'm sharing my observations not as an MVP but as someone who does technical support for a living. ... which means they don't want others taking advantage of that file type and allowing a malicious file to launch Word. ... Allow me to save/edit/open a word document with no extension, ... Although Apple deprecated file type and creator codes some time ago, they still haven't removed support for them. ...
    (microsoft.public.mac.office.word)
  • Re: Running other applications
    ... associated with a file type (extension). ... file and calling FindExecutable: ... ByVal lpDirectory As String, ByVal lpResult As String) As Long ... > The app is a program called Data Junction. ...
    (microsoft.public.vb.general.discussion)

Loading