|
-
Feb 12th, 2004, 06:40 AM
#1
Thread Starter
Addicted Member
File association - running a batch file minimized
I've got a custom application (written by an external contractor) which edits configuration files. The application accepts no command line arguments and has no open or save dialogs. To edit a file, it expects the file to exist with a particular file name in its own directory.
This is a pain in the neck because it means every time I want to alter one of these config files, I need to copy it over, rename it, use the editor then copy it back afterwards.
I've written a very simple (Dos) batch file to do this and set up a file association in Windows so that when ever I double click one of the config files it launches the batch file. That works a treat with the caveat that I can only open one config file at a time.
The only thing that annoys me is that the batch file runs in a big ugly command prompt window that hangs around for the time I have the config file open. I've done gotten around this sort of thing in the past by creating a .pif shortcut to the batch file that tells it to run minimized and setting the Windows file association to call the .pif file rather than the batch file. In Windows XP, the .pif has become a standard .lnk shortcut (ok, whatever) but I can't point my file association to the .lnk file, and if I point it to the .bat file it ignores the .lnk. 
So I'm wondering if there is a command line switch I can send to the .bat file (or to cmd.exe) that tells it to run minimized, or if I can have the file association send a DDE message to the command window telling it to minimize or if there's anything else I can do to make it play ball...?
Failing that I guess I'm gonna have to figure out the FileSystemObject and do it in a .vbs script. (Which I can't really be bothered with right now! )
-
Feb 12th, 2004, 10:23 AM
#2
Why don't you right-click the file select the "Shortcut" tab, then choose Run --> Minimized window
-
Feb 14th, 2004, 03:06 PM
#3
Thread Starter
Addicted Member
Doesn't work. It did in previous Windows versions, but not in XP Pro.
This creates a shortcut (.lnk file) to the batch file which stores the run minimized information. When the file association in Windows calls the batch file it ignores the shortcut and runs it in a normal window.
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
|