View Single Post
Old 08-13-2019, 07:14 PM   #16
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,498
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by RbnJrg View Post
I made a bat file with the following command:

MyProgram.exe -u %1

and I saved all as "MyBat.bat". If I drop a .xhtml file on that .bat, all works fine but if I want to proccess a .xhtml file with the same .bat by means of "Open with..." nothing happens. What am I doing wrong?
Since you mentioned that the batch file and the executable file are in the same directory, could you try modifying the batch file to:

%~dp0MyProgram.exe -u %1

The %~dp0 variable points to the drive and path of the batch file which is the same location you have the .exe file located. Otherwise, you'll need to either have the path to the executable in one of Window's path variable or specify the full path to the the executable.
DNSB is offline   Reply With Quote