VFP Run Command

How to launch a VFP RUN command without DOS window showing up?

I am trying to change the settings in the BullZip PDF printer driver. I can do it with:

           RUN /N7 BZCONFIG.EXE /S OUTPUT "FileName"

but the DOS window flashes annoyingly. Any to to hide the DOS window.

Who is Participating?
nordtorpConnect With a Mentor Commented:
MichaelKatz, are you looking for somethink like this? http://support.microsoft.com/kb/141551
MichaelKatzAuthor Commented:
Possibly. I was hoping for something simpler like a setting or parameter.

I'll try this and get back.


Happy Holidays.
CaptainCyrilConnect With a Mentor Founder, Software Engineer, Data ScientistCommented:
= ExecuteShell("BZCONFIG.EXE", "", "", ' /S OUTPUT "FileName"')

FUNCTION ExecuteShell
LPARAMETERS cFile, cOperation, cDefaultDirectory, cParameters
LOCAL nHwnd, cParameters, cDefaultDirectory, nShowWindow
DECLARE INTEGER ShellExecute IN shell32.dll AS ShellExecute;
      INTEGER nHwnd,;
      STRING @cOperation,;
      STRING @cFile,;
      STRING @cParameters,;
      STRING @cDefaultDirectory,;
      INTEGER nShowWindow
nHwnd = 0
cOperation = IIF(EMPTY(cOperation),'open',cOperation)
cParameters = IIF(EMPTY(cParameters),NULL,cParameters)
cDefaultDirectory = IIF(EMPTY(cDefaultDirectory),'',cDefaultDirectory)
nShowWindow = 1
= ShellExecute(nHwnd, @cOperation, @cFile, @cParameters, @cDefaultDirectory, nShowWindow)
MichaelKatzAuthor Commented:
Nordtorp & captaincyril

Both methods work to hide the command window but for some reason the changes do not take effect. I believe it is because a new instance of comspec is initiated and is not visible to the printer driver.

I solved the problem by changing the calling window method AlwaysOnTop to True and then back to False.

Thanks anyway
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.