Open a file using software in vbs

Solved
Hello CCM,
I would like to know if it is possible to open a file using a software, I already know:
Dim Sh 
Set Sh = CreateObject("WScript.Shell")
Sh.Run "text.txt"
Set Sh = Nothing
But is it possible to choose (in the program) the software to use to open it? (For example, to open it with Notepad++ instead of Notepad).

Thank you in advance for your answers :D

1 answer

  • Votes
  • Date
  • Descending date
  1. Contributor
    Hello,

    like this:

    Dim shell As Object, path As String Set shell = CreateObject("WScript.Shell") path = "C:\Users\....\Documents\myfile.txt" 'adapt the path shell.Run "Notepad " & path


    --
    @+ The Woodpecker
    1. You're welcome!