We help IT Professionals succeed at work.

A script to change the "command line" in a DOS PIF file

Bryan Butler
Bryan Butler used Ask the Experts™
on
Is there a way, in any language, to change the "command line" part of a PIF file?  I'm using a PIF file to get around a 'full screen' mode requirement of an EXE I'm running.  The EXE takes a filename (or the base of the filename) as the parameter, and i need to run this on a bunch of filenames.  So I need to automatically change the 'command line' part without going through the GUI.  
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
I don't know if that'll work. But why don't you just move the original PIF file and copy a new PIF file with the new command line in its place?
Steven CarnahanAssistant Vice President\Network Manager

Commented:
http://techsupt.winbatch.com/TS/T000001058F31.html

Can you do something like that?

Author

Commented:
Not sure what exactly you mean.  If I go to the "properties" after I create a pif file, then open the "program" tab, there is a "cmd line:" value that I fill in with: "c:\dump-hac.exe <hac number>".  This hac number is what I need to change each time.  I want to create or modify the PIF on the fly.  I'll loop through a list of <hac number> and run the PIF for each one.

Author

Commented:
Thanks pony.  I saw that and tried it.  I'll try it again as I never got it working.  

Author

Commented:
Oh, I got it.  I think I get what svgmuc is saying.  I'll just keep the  (hac filename) the same each time (kinda like place marker)  and change the contents of the file to be the "real" file.  So then I just keep track of the hac number I'm put in the place marker and handle the output appropriately.