Opening a specific file with a batch file?

I would like to know how I can open a specific file using a specific program with a batch file. So far, my batch file can open the program, but I'm not sure how to open the file with this program.

@echo off
start wgnuplot.exe
+3
source share
8 answers
start wgnplot.exe "c:\path to file to open\foo.dat"
+8
source
@echo off
start %1

or, if necessary, to avoid characters -

@echo off
start %%1
+2
source

API, .

, 7Zip zip . 7Zip API ( x).

"C:\Program Files\7-Zip\CommandLine\7za.exe" x C:\docs\base-file-structure.zip 
+1

program "file"

. start, ; , .

, , - , , - . , , , .

, , . , .

+1

, , , (.bat) , :

start filename.filetype

: start image.png

+1

, , , , .bat. Textpad Microsoft Application Virtualization ( "AppV" ). Textpad " AppV", . App Store Textpad ...

%ALLUSERSPROFILE%\Microsoft\AppV\Client\Integration\
 12345ABC-A1BC-1A23-1A23-1234567E1234\Root\TextPad.exe

textpad.exe 'txt' 'bat':

1) (txt) opentextpad.bat

2) opentextpad.bat :

textpad.exe %1  

3)

4) Windows, txt (, "dummy.txt" ) " > ..." . " " "...", textpad.bat. "". " ". " ". "", .

"txt", "textpad.exe".

, .

+1
@echo off
cd "folder directory to your file"
start filename.ext

:

cd "C:\Program Files (x86)\Winamp" 
Start winamp.exe
0
source

If you try to open the file in the same directory, this will be:

./PROGRAM TRYING TO OPEN
./FILE NAME/PROGRAM TRYING TO OPEN (or this)

Or, if you try to step back from a single directory, it will be:

../PROGRAM TRYING TO OPEN
../FILE NAME/PROGRAM TRYING TO OPEN (or this)

Otherwise, if you need a straight line from the beginning, it will be:

(DIRECTORY TYPE)\Users\%username%\(FILE DIRECTORY)
(ex) C:\Users\ajste\Desktop\Henlo.cmd
0
source

Source: https://habr.com/ru/post/1740197/


All Articles