Comments (5)
Hello,
Finally I found the following solution: in mc.ext
the lines Open=...
or View=...
invoking doc.sh
can be replaced by:
Open=cmd /c start openprogram %p
View=cmd /c start viewerprogram %p
where openprogram
and viewerprogram
are exe programs that can be found in the DOS PATH.
For instance for ms word/excel/powerpoint, one could use:
# Microsoft Word Document
regex/i/\.(do[ct]|wri|docx)$
Open=cmd /c start winword %p
View=cmd /c start winword %p
type/^Microsoft\ Word
Open=cmd /c start winword %p
View=cmd /c start winword %p
# Microsoft Excel Worksheet
regex/i/\.(xl[sw]|xlsx)$
Open=cmd /c start excel %p
View=cmd /c start excel %p
type/^Microsoft\ Excel
Open=cmd /c start excel %p
View=cmd /c start excel %p
# Microsoft PowerPoint Presentation
regex/i/\.(pp[ts]|pptx)$
Open=cmd /c start powerpnt %p
View=cmd /c start powerpnt %p
Finally, as start "" filename.ext
makes WIN opening the file with the default program based on extension, one can put on top of mc.ext
:
Open=cmd /c start "" %p
This will directly open the file with the default program.
@adamyg : I made few web search, but I did not find recipes to open/view files with mcwin32 (but maybe I did not use the correct keywords). It could be helpful to do so and/or change the default mc.ext
so that files with current extensions could be directly opend/read with RETURN
/ F3
keys ?
from mcwin32.
need an example use-case; scripts can always exec "start file-name" gaining win shell file association features.
from mcwin32.
I.e. I have some *.pdf file, which opens with MS edge in Explorer. When I execute it in mc (with RETURN key), nothing happens. The same with *.doc, *.xls and other file formats with windows assosiations.
I believe it's hard to implement archive processing inside mc in win, am I right?
from mcwin32.
Hello,
Currently the workaround I found to open a file from mc in a external application is to run the following in mc command line:
$ start program %f
start
is a DOS command -- typehelp start
on a command window for details,program
is the name of the executable, with or without its extension. In the case of MS word, for instance, the executable iswinword.exe
and generally in the PATH, sowinword
should work.%f
is the mc macro for the currently selected file.
So providing a .doc or .docx file is selected in the active panel, the following should work :
$ start winword %f
or equivalently:
$ start winword
followed by CTRL + RETURN
to add the filename
@eugenov , regarding your initial question: when I just type RETURN
on a word file I have the following error (I guess that you should see a similar error, but you must type CRL+o
to see the full output of the command line)
I don't know much about its implementation, but I suppose that mc is able to execute a part of doc.sh. Here for instance It recognize that type of file is a msdoc, but can't execute wvHtml or elinks which are linux commands.
I agree with you it would be nice being able to directly open the files by typing RETURN
. I think that the mc.ext
file is meant to do that, but I hanven't figured out yet how to properly do that in windows...
from mcwin32.
The diagnostics reported is result of the logic within plugin/doc.sh (below); which is assuming a unix / open-office / abiword environment; shall consider reworking
wvHtml "${MC_EXT_FILENAME}" --targetdir="$tmp" page.html -1
elinks "$tmp/page.html"
from mcwin32.
Related Issues (20)
- Mbed TLS 3.4.1 HOT 3
- zlib 1.3 HOT 4
- Windows 64 (x64) release builds are missing HOT 3
- file-5.45 HOT 1
- Windows 10: running mc.exe under git-bash console do not work. HOT 6
- MC fails to start (VCRUNTIME140.dll is missing) HOT 2
- MC fails on a subst - drive HOT 3
- Mbed TLS 3.5.x HOT 1
- Review CodePage integration
- Missing mc-wrapper.sh script
- Midnight Commander 4.8.31 (2024-01-27)
- `\` seems to be ignored HOT 8
- Switch between drives HOT 3
- Very slow on network locations HOT 4
- not possible to compare files HOT 8
- Review busybox cmd list.
- Mbed-TLS 3.6.0
- Internal tools, externalized
- 64 bit installer wants to install into C:\Program Files (x86) HOT 1
- MC on Windows 11 / PowerShell, wrong folder after exit. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcwin32.