VOGONS

Common searches


First post, by samurai76

User metadata
Rank Newbie
Rank
Newbie

Hi, my name's samuele. I'm Italian so...sorry fo my English.

In win XP I opened a example.file with right clic>open with and I selected the example.exe program.

Now in win 7 example.exe doesen't run so I tried to run it through dosbox automaticly.

In dosbox.conf under [autoexec] I put

Mount c c:\pathtodosboxportable (with example.exe program insidie)
C:
Example.exe

So when I double-click dosboxportable.exe example.exe run automaticly.

If I put

Mount c c:\pathtodosboxportable (with example.exe program insidie)
C:
Example.exe example.file

Example.file is opened correctly

What I can write if I want open a different example.file every time automaticly by clicking on it.

Thankyou very much

Samuele

Reply 1 of 17, by Solarstorm

User metadata
Rank Member
Rank
Member

I think i understand what you want, but i think this is impossible.
Edit: Well, not impossible, but not easy.
If you want to open a file automatically you would need to change the .conf file everytime to the file you want to open.
If the program works under XP you can try to set the compatibility mode for the exe file in its options.
Or if you own a Windows 7 Professional you can make use of the XP virtual machine you get from MS.

My YouTube Channel

Reply 2 of 17, by collector

User metadata
Rank l33t
Rank
l33t

Just create a shortcut to DOSBox and add the path to the EXE you want to run as an argument after the path to DOSBox. i.e., in the target box of the shortcut properties:

"C:\Program Files (x86)\DOSBox 0.74\dosbox.exe" "<Path to EXE>"

Adjust paths to match what you have.

The Sierra Help Pages -- New Sierra Game Installers -- Sierra Game Patches -- New Non-Sierra Game Installers

Reply 3 of 17, by Tertz

User metadata
Rank Oldbie
Rank
Oldbie
samurai76 wrote:
Now in win 7 example.exe doesen't run so I tried to run it through dosbox automaticly. <...> If I put Mount c c:\pathtodosboxpor […]
Show full quote

Now in win 7 example.exe doesen't run so I tried to run it through dosbox automaticly.
<...>
If I put
Mount c c:\pathtodosboxportable (with example.exe program insidie)
C:
Example.exe example.file
Example.file is opened correctly
What I can write if I want open a different example.file every time automaticly by clicking on it.

Lets name example.file as example.ext, example.exe as app.exe

c:\app\ - folder with app.exe
c:\dosbox\ - folder with dosbox used for opening *.ext

1) Insert in [autoexec] of dosbox.conf:
mount c c:\app\
c:
app.exe somefile.ext

2) create open_ext.bat:
@echo off
if exist c:\app\somefile.ext del c:\app\somefile.ext
copy %~f1 c:\app\somefile.ext
c:\dosbox\dosbox.exe -conf c:\dosbox\dosbox.conf -c "exit"

3) associate in system *.ext files with open_ext.bat

DOSBox CPU Benchmark
Yamaha YMF7x4 Guide

Reply 5 of 17, by samurai76

User metadata
Rank Newbie
Rank
Newbie

@Terz

...be patient...and if I want open an ¨*.ext file¨ with a variable extention?

Files that I open have differt extention because I name them according to my needs and I need modify extentions to identify better what is ¨inside¨.

Thank you

Samuele

Reply 6 of 17, by Tertz

User metadata
Rank Oldbie
Rank
Oldbie
samurai76 wrote:

and if I want open an ¨*.ext file¨ with a variable extention?
Files that I open have differt extention because I name them according to my needs and I need modify extentions to identify better what is ¨inside¨.

You may use names for info, instead of extensions. For example name [info].ext, or name.info.ext. Then if you'll want to choose files by [info] you may use FAR as filemanager, its search "*info*" will give a panel with found files and it has extended renaming possibility. Also if you'll want to change [info] to something you may use a more powerful renamer.

With different extensions you'll need to choose every time open_ext.bat from "Open with.." system menu, what is less comfortable. To support different extensions you need:

1) Insert in [autoexec] of dosbox.conf:
mount c c:\app\
c:

2) Create open_ext.bat:
@echo off
if exist c:\app\somefile%~x1 del c:\app\somefile%~x1
copy %~f1 c:\app\somefile%~x1
c:\dosbox\dosbox.exe -conf c:\dosbox\dosbox.conf -c "app.exe somefile%~x1" -c "exit"

3) associate in system *.ext files with open_ext.bat. After association with any extension, open_ext.bat should to exist in "open with..." system menu.

DOSBox CPU Benchmark
Yamaha YMF7x4 Guide

Reply 7 of 17, by collector

User metadata
Rank l33t
Rank
l33t

Why mess with the Registry by creating needless new associations when there are so many better ways to do it without touching the Registry? You would still have to individually setup each game for its individual needs.

The Sierra Help Pages -- New Sierra Game Installers -- Sierra Game Patches -- New Non-Sierra Game Installers

Reply 8 of 17, by samurai76

User metadata
Rank Newbie
Rank
Newbie
collector wrote:

Why mess with the Registry by creating needless new associations when there are so many better ways to do it without touching the Registry? You would still have to individually setup each game for its individual needs.

...sorry collector but I`m not tell about games. I need to open every time a different file to visualize it through example.exe. My problem is not setup but semplify process to open files.

Reply 9 of 17, by samurai76

User metadata
Rank Newbie
Rank
Newbie
Tertz wrote:
You may use names for info, instead of extensions. For example name [info].ext, or name.info.ext. Then if you'll want to choose […]
Show full quote
samurai76 wrote:

and if I want open an ¨*.ext file¨ with a variable extention?
Files that I open have differt extention because I name them according to my needs and I need modify extentions to identify better what is ¨inside¨.

You may use names for info, instead of extensions. For example name [info].ext, or name.info.ext. Then if you'll want to choose files by [info] you may use FAR as filemanager, its search "*info*" will give a panel with found files and it has extended renaming possibility. Also if you'll want to change [info] to something you may use a more powerful renamer.

With different extensions you'll need to choose every time open_ext.bat from "Open with.." system menu, what is less comfortable. To support different extensions you need:

1) Insert in [autoexec] of dosbox.conf:
mount c c:\app\
c:

2) Create open_ext.bat:
@echo off
if exist c:\app\somefile%~x1 del c:\app\somefile%~x1
copy %~f1 c:\app\somefile%~x1
c:\dosbox\dosbox.exe -conf c:\dosbox\dosbox.conf -c "app.exe somefile%~x1" -c "exit"

3) associate in system *.ext files with open_ext.bat. After association with any extension, open_ext.bat should to exist in "open with..." system menu.

...thanks for your availability...I`ll tryat work next week.

Samuele

Reply 10 of 17, by Tertz

User metadata
Rank Oldbie
Rank
Oldbie
collector wrote:

Why mess with the Registry by creating needless new associations

Extensions association may to be done with OS interface.

there are so many better ways to do it without touching the Registry

You are welcome to say better solution for his task.

DOSBox CPU Benchmark
Yamaha YMF7x4 Guide

Reply 11 of 17, by collector

User metadata
Rank l33t
Rank
l33t

It is still making Registry entries whether you do it directly through Windows or through some third party utility. This is not anything that is required by any DOS game. and DOSBox is not recommended for anything other than games. DOSBox IS NOT SUITED TO RUN YOUR NON-GAMING DOS APPLICATION

The Sierra Help Pages -- New Sierra Game Installers -- Sierra Game Patches -- New Non-Sierra Game Installers

Reply 12 of 17, by samurai76

User metadata
Rank Newbie
Rank
Newbie

...excuse me Terz...

Does ¨copy %~f1 c:\app\somefile.ext¨ stands for ¨copy example.ext selected in its path in c:\app\ and rename it in somefile.ext?

If so can I write ¨copy %~f1 c:\app\*.*¨ to copy in c:\app\ the same file or it`s better ¨copy %~f1 c:\app\%~f1¨

Reply 13 of 17, by Tertz

User metadata
Rank Oldbie
Rank
Oldbie
samurai76 wrote:

Does ¨copy %~f1 c:\app\somefile.ext¨ stands for ¨copy example.ext selected in its path in c:\app\ and rename it in somefile.ext?

Yes.

If so can I write ¨copy %~f1 c:\app\*.*¨ to copy in c:\app\ the same file

This way it will copy .ext file to c:\app\, but will not rename it. So instead of only 1 file (somefile.ext) in your c:\app\, there will begin gather many unneeded copies, and to prevent this you'd need to insert command like 'del c:\app\*.ext' instead of 'del c:\app\somefile.ext'. It would be same, not better.

or it`s better ¨copy %~f1 c:\app\%~f1¨

No.
%~f1 means full pathname of file like d:\somewhere\example1.ext. Where 1 means 1st parameter given to open_ext.bat; in your case it's a name of some .ext file you opening by clicking in OS.
Your construction will result the string:
c:\app\d:\somewhere\example1.ext

You may test different variants and check the results.
If you'll insert 'echo' befor strings in .bat file and place 'pause' at end, then you'll see what commands it tryes to execute, but without execution itself. For example, you may change open_ext.bat in such way and then click some .ext:

@echo off
echo if exist c:\app\somefile.ext del c:\app\somefile.ext
echo copy %~f1 c:\app\somefile.ext
echo c:\dosbox\dosbox.exe -conf c:\dosbox\dosbox.conf -c "exit"
pause

If you are interested in DOS script language and want to play with it, there are many sources found through google by a search like: bat dos commands

DOSBox CPU Benchmark
Yamaha YMF7x4 Guide

Reply 14 of 17, by samurai76

User metadata
Rank Newbie
Rank
Newbie
Tertz wrote:
Yes. […]
Show full quote
samurai76 wrote:

Does ¨copy %~f1 c:\app\somefile.ext¨ stands for ¨copy example.ext selected in its path in c:\app\ and rename it in somefile.ext?

Yes.

If so can I write ¨copy %~f1 c:\app\*.*¨ to copy in c:\app\ the same file

This way it will copy .ext file to c:\app\, but will not rename it. So instead of only 1 file (somefile.ext) in your c:\app\, there will begin gather many unneeded copies, and to prevent this you'd need to insert command like 'del c:\app\*.ext' instead of 'del c:\app\somefile.ext'. It would be same, not better.

or it`s better ¨copy %~f1 c:\app\%~f1¨

No.
%~f1 means full pathname of file like d:\somewhere\example1.ext. Where 1 means 1st parameter given to open_ext.bat; in your case it's a name of some .ext file you opening by clicking in OS.
Your construction will result the string:
c:\app\d:\somewhere\example1.ext

You may test different variants and check the results.
If you'll insert 'echo' befor strings in .bat file and place 'pause' at end, then you'll see what commands it tryes to execute, but without execution itself. For example, you may change open_ext.bat in such way and then click some .ext:

@echo off
echo if exist c:\app\somefile.ext del c:\app\somefile.ext
echo copy %~f1 c:\app\somefile.ext
echo c:\dosbox\dosbox.exe -conf c:\dosbox\dosbox.conf -c "exit"
pause

If you are interested in DOS script language and want to play with it, there are many sources found through google by a search like: bat dos commands

...fantastic Terf...I'll try what is in my mind tomorrow and then post it here.

You are great...thank you very much.

Samuele

Reply 15 of 17, by samurai76

User metadata
Rank Newbie
Rank
Newbie

Eureka!!! Thank you all!

I solved my problem with this batch:

@echo off
del c:\dosboxportable\target_file\*.*
copy C:\DOSBoxPortable\dosbox.conf C:\DOSBoxPortable\Data\settings\
copy c:\dosboxportable\APP.exe c:\dosboxportable\target_file\
copy %~f1 c:\dosboxportable\target_file\%~n1%~x1
echo [autoexec] >> C:\DOSBoxPortable\Data\settings\dosbox.conf
echo mount c c:\dosboxportable\target_file\ >> C:\DOSBoxPortable\Data\settings\dosbox.conf
echo c: >> C:\DOSBoxPortable\Data\settings\dosbox.conf
echo APP.exe %~n1%~x1 >> C:\DOSBoxPortable\Data\settings\dosbox.conf
c:\dosboxportable\dosboxportable.exe -conf C:\DOSBoxPortable\Data\settings -c ¨exit¨

Thank you for your advices.

Samuele

Reply 16 of 17, by Tertz

User metadata
Rank Oldbie
Rank
Oldbie
samurai76 wrote:

I solved my problem with this batch

Your .bat makes in essence what did my variant for random .ext, while yours have additonal disk writes and hence should be slower. I see no advantage of it and have no idea what you've found wrong with my solution. But I'm glad then even worse code satisfies.
Was funny to help you.

>
copy %~f1 c:\dosboxportable\target_file\%~n1%~x1
may be changed to
copy %~f1 c:\dosboxportable\target_file\

> echo mount c c:\dosboxportable\target_file\ >> C:\DOSBoxPortable\Data\settings\dosbox.conf

Instead of modification of .conf it's more reasonably to use "-c" commands of dosbox. While static strings is more reasonably to write in .conf a single time, but not with every .bat run.

DOSBox CPU Benchmark
Yamaha YMF7x4 Guide

Reply 17 of 17, by samurai76

User metadata
Rank Newbie
Rank
Newbie
Tertz wrote:
samurai76 wrote:

I solved my problem with this batch

Your .bat makes in essence what did my variant for random .ext, while yours have additonal disk writes and hence should be slower. I see no advantage of it and have no idea what you've found wrong with my solution. But I'm glad then even worse code satisfies.
Was funny to help you.

Yes, you are right...but there was some conditions that I didn`t know.

I need view the name of opened file and app.exe don`t run with a path...for example I can`t write app.exe c:\target_file\file.ext, I have to write app.exe file.txt.

I don`t know if I can improve the code but it runs and this is important for me!!!
I didn`t want to annoy this forum with an O.T. thread...so I tried to finished the code alone.
However your advice were indispensable. I didn`t do it without you.

> copy %~f1 c:\dosboxportable\target_file\%~n1%~x1 may be changed to copy %~f1 c:\dosboxportable\target_file\ […]
Show full quote

>
copy %~f1 c:\dosboxportable\target_file\%~n1%~x1
may be changed to
copy %~f1 c:\dosboxportable\target_file\

> echo mount c c:\dosboxportable\target_file\ >> C:\DOSBoxPortable\Data\settings\dosbox.conf

Instead of modification of .conf it's more reasonably to use "-c" commands of dosbox. While static strings is more reasonably to write in .conf a single time, but not with every .bat run.

Thank you for details...I`ll try them.

Bye
Samuele