[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 790
  • Last Modified:

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.

  • 2
2 Solutions
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.
= 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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now