-
Open specific file with specific app
Hi I am making a CD project for myself and I've run into a little snag. I am currently using Northcode's "proxy.exe" (thanks btw, that little app has been a life saver) but I have no idea what command to use in the bat file to do this. I've searched google for bat commands, but none seemed to be the one I need.
Example,
I have a file "File.zip" and I want it to be opened by a specific app on the CD "App1.exe". We'll say that the app and file are in the same folder called "apps" (/fscommand/apps). How would I do this from the .bat file?
-
Lifetime Friend of Site Staff
Normally the command would be something like .\apps\app1.exe file.zip assuming that the BAT files is in the fscommand folder. That might vary depending on how the application expects to see the arguments on the command line (there might be switches, options, etc.)
-
Thanks, I'll give it a shot.
-
Ok, so it opens the App fine, just not the specific file.
-
Lifetime Friend of Site Staff
Make sure the app accepts command line parameters (not all do) and that you're supplying them properly.
-
And if it doesn't?
I tried using the windows "open with" and selected the .exe and it works, don't know if that helps.
-
Lifetime Friend of Site Staff
It depends what application you're talking about and how it opens the target file. Windows apps can use the command line or DDE. If it's DDE only (mostly for older apps) then you're SOL. If it's a command line then all you have to do is look in the registry to find out how Windows opens the file and duplicate that in your BAT file. You can also do this through the Windows Explorer menu if you don't know where to look in the registry.
1. Open any folder
2. Select Tools menu at the top of the Window
3. Select Folder Options from the menu
4. Select the File Type tab
5. Find the file type in the list and select it
6. Click on the Advanced button to bring up the Edit File Type dialog
7. Select the verb from the list (you want open if it's there)
8 Press the Edit Button to show the command that will run
I picked EML (email) files and when I look at the command that's going to run when I click on an EML file to open it, it's this...
"C:\Program Files\Outlook Express\msimn.exe" /eml:%1
That's the command line I'd have to run (with %1 replaced by the file I want to open) to get an EML file to open in Outlook Express.
-
Got it!
It ended up being:
start .\Gen\Fusion.exe ".\Gen\S_D.zip"
Thanks a lot!
-
Lifetime Friend of Site Staff
You don't need the call to start in there. Normally you would only use start to launch an application if you wanted to specify some additional operating parameters.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|