open .dat with a program

March 10, 2010 at 15:09:06
Specs: Windows XP
There's a .dat file I want to always open with a certain program, but I don't want ALL of my .dat files to open with that program. How can I create a script or batch or executable file to do that (or are those all the same?) I want to open "test.dat" with "loadmsg.exe" (both are in the "My Documents" folder) by creating something that only requires one click instead of dragging the file to the program.

See More: open .dat with a program

Report •

#1
Report •

#2
March 12, 2010 at 17:25:41
Thanks for the link, but what I'm trying to do is create something that I only have to double-click and it runs "test.dat" with "loadmsg.exe". The link seems to be telling me to right-click and send it to the program.

Report •

#3
March 12, 2010 at 18:53:40
You can create a batch file with the line

"loadmsg.exe test.dat"

But that will only work if loadmsg.exe accepts command line parameters and that is dependant on the programmer that wrote the application.

To automatically load any application from a data file requires that the application can accept command line parameters as that is how they all work. Ultimately you are running the application with a command line parameter in all cases.

Stuart


Report •

Related Solutions

#4
March 13, 2010 at 10:14:22
Is that everything I need in the file, or do I need some sort of initiate command or file paths or other stuff? Also, would this run by double-clicking, or would I have to do some other stuff to make it a .exe

Report •

#5
March 13, 2010 at 11:16:58
You will need to put the complete path of the .EXe and the dat file.

Stuart


Report •

#6
March 13, 2010 at 16:37:04
I tried using IExpress and when I run the application it says "Error creating process <Command.com /c
C:\Users\Andy\AppData\Local\Temp\IXP000.TMP\testprg.bat>. Reason: The system cannot find the file specified."

The files I included in IExpress were loadmsg(which is a .exe), test.dat, and testprg(which is a .bat). IExpress wrote testrun(which is a .exe) and testrun.SED. I could only open the scripts for testprg, which I wrote, and testrun.SED, which IExpress wrote.

testprg says "C:\Users\Andy\Documents\BETA DRIVE\Computer Fun\mm_deluxe\loadmsg.exe C:\Users\Andy\Documents\BETA DRIVE\Computer Fun\mm_deluxe\test.dat"

testrun.SED says [Version]
Class=IEXPRESS
SEDVersion=3
[Options]
PackagePurpose=InstallApp
ShowInstallProgramWindow=0
HideExtractAnimation=1
UseLongFileName=0
InsideCompressed=0
CAB_FixedSize=0
CAB_ResvCodeSigning=0
RebootMode=N
InstallPrompt=%InstallPrompt%
DisplayLicense=%DisplayLicense%
FinishMessage=%FinishMessage%
TargetName=%TargetName%
FriendlyName=%FriendlyName%
AppLaunched=%AppLaunched%
PostInstallCmd=%PostInstallCmd%
AdminQuietInstCmd=%AdminQuietInstCmd%
UserQuietInstCmd=%UserQuietInstCmd%
SourceFiles=SourceFiles
[Strings]
InstallPrompt=
DisplayLicense=
FinishMessage=
TargetName=C:\Users\Andy\Documents\BETA DRIVE\Computer Fun\mm_deluxe\testrun.EXE
FriendlyName=test
AppLaunched=testprg.bat
PostInstallCmd=<None>
AdminQuietInstCmd=
UserQuietInstCmd=
FILE0="loadmsg.exe"
FILE1="test.dat"
FILE2="testprg.bat"
[SourceFiles]
SourceFiles0=C:\Users\Andy\Documents\BETA DRIVE\Computer Fun\mm_deluxe\
[SourceFiles0]
%FILE0%=
%FILE1%=
%FILE2%=

In IExpress I put testprg as the application.

What did I do wrong?


Report •

#7
March 15, 2010 at 18:53:05
I've figured it out. I create a shortcut of the program, and then add the file location after it in the target line. Thanks for all the suggestions

Report •

#8
May 20, 2010 at 10:44:31
Hello...
i'm facing the same problem, cannot find the file!

could you please explane me your last post with some more
details? i don't understand what is the target line and what
exactly i have to type in it

thank you very much
Marco


Report •

#9
May 20, 2010 at 17:00:00
OK, but I have some questions.
First, on your computer can you see the extensions? (the .exe or .dat or .txt or "dot-something") What are they?
Second, right-click the file and select "Properties". Tell me the location. Do the same for the program.
Third, what is the file and what is the program?
Tell me these and I'll get back to you.

Report •

#10
May 21, 2010 at 00:08:46
Goog morning (for you it's still night :P)

i do see extensions. my file is a .txt

location of file:
C:\Users\VecchiaSpugna\Desktop\ciao.txt

location of program:
C:\Users\VecchiaSpugna\Desktop\try.bat

the file is ciao.txt, the program is try.bat

thanks a lot


Report •

#11
May 24, 2010 at 15:59:39
Right-click the program and create a shortcut. Then, right-click the shortcut and click Properties. In the location, after "C:\Users\VecchiaSpugna\Desktop\try.bat", put a space and type "C:\Users\VecchiaSpugna\Desktop\ciao.txt" with the qotation marks. You're done! When you double-click the shortcut, it will open the file with the program. Just be sure that if you move the file somewhere else to change the location in the shortcut too. I don't know any other solutions, so if this doesn't work, it's too bad.

Report •

Ask Question