Search code examples
windowsbatch-filecmd

"Open With" using CMD


Let's say I have a program that I want to open. I can open it using batch by running this:

@echo off
start "" "C:\Program.exe"

Is there a way to tell batch that I want to open the file using a program such as notepad? Something along the lines of this:

start "" "C:\Program.exe" >notepad.exe

Solution

  • Not sure, but you can use

    @echo off
    notepad.exe "C:\Program.exe"
    

    You can use every program that supports "Open With" (every good program supports it) The File-Path will be passed to the program, so it knows your file.