Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VFP Suppress Command Window Popup

Posted on 2012-09-11
9
Medium Priority
?
2,127 Views
Last Modified: 2012-09-11
Hello all. I am currently using Wget with '!' and that results in an ugly Windows Command window popup.

Is there any way to suppress that window?
0
Comment
Question by:formadmirer
  • 4
  • 4
9 Comments
 
LVL 59

Expert Comment

by:Bill Prew
ID: 38388567
Have you tried this?

http://support.microsoft.com/kb/141551

~bp
0
 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 38388569
So you talk about cmd.exe. The config of that is in FoxRun.pif in Home()+"Tools\FoxRun". Look into it's properties.

Bye, Olaf.
0
 

Author Comment

by:formadmirer
ID: 38388953
Thanks.  This sounds great and much easier than I thought the answer would be.

A couple of questions though.

I'm assuming since it's a pif file that it can be redistributed.
Assuming that it can, would it be beneficial to move it into my project's root folder?

I've not made anything that would be used with an installer before so I don't know what gets included and what doesn't. After all it wouldn't do much good if the cmd window was suppressed for me, but not for anyone else who uses the prog.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 38388979
Quoted from help, indeed COMSPEC is to be preferred to the pif file. You can still use the pif and then would put it to the runtime...

Oh, and /N also is an option, if wget is an exe.

quote:

RUN and Visual FoxPro
The RUN command (without /N parameter) uses the following sequence order to determine which program to use when executing the specified RUN command:

Named PIF file - if the program you specify in RUN does not have an extension, Visual FoxPro first looks for a Program Information File (PIF) with the name you specify. If the PIF file is found, the program specified in the PIF is executed with the PIF parameters.

FOXRUN.PIF file - if a Named PIF file can not be found, the RUN command searches for the default Foxrun.pif file. If this file is found, the program specified in Foxrun.pif is executed with the PIF parameters.

COMSPEC Environment Variable - if no PIF file is found which meets the above criteria, the RUN command uses the SHELL program specified by the Windows operating system COMSPEC environment variable. This variable typically points to Cmd.exe, however, in older operating systems such as Windows 98, it will point to Command.com.

Note  
For Visual FoxPro 9, the Foxrun.pif file is no longer installed in the Visual FoxPro root directory so that it is no longer used by default. The default behavior for Visual FoxPro 9 is that a RUN command (without /N parameter) should use the SHELL program specified by the COMSPEC environment variable. Foxrun.pif is now installed in the Visual FoxPro Tools directory if needed.
 

A PIF lets you run other programs under Windows. You can specify parameters for the program, such as whether the program is run in a window or on the full screen, the amount of memory allocated for the program, and so on.

If intended to be used, Foxrun.pif must be in the same directory as VFPVersionNumber.exe where VersionNumber represents the version number of this release of Visual FoxPro.

Unless needed, a PIF file should be avoided since the RUN command automatically use Command.com to call the program specified in the PIF file. For example, if your PIF file specified Cmd.exe as the program to run, Visual FoxPro would actually have Command.com call Cmd.exe to execute the specified RUN command, which may not be the desired behavior. It is preferable to have the RUN command directly use the SHELL program specified by the operating system's COMSPEC environment variable.

Bye, Olaf.
0
 

Author Comment

by:formadmirer
ID: 38389024
Yes, wget is an exe.

Thanks Olaf. Your information is much more detailed than that which I found searching the Microsoft website: http://msdn.microsoft.com/en-us/library/1tced27e%28v=vs.80%29.aspx

So far I have tried every way I can think of to call wget.exe but no matter what I do the command window still appears.

I'm curious as to why the info you have says that the pif file must be located in the same directory as VFPVersionNumber.exe, where the info I got seems to indicate you can supply your own path to where the pif is located.

anyway the command window is still there...
0
 
LVL 30

Accepted Solution

by:
Olaf Doschke earned 2000 total points
ID: 38389042
There is a main topic for each command, function, property, method, event, class, etc. in the reference section of the help. Changes topics just tell you about changes...

Is it really the cmd.exe or command.com window displayed wget is a linux bash command ported to windows, what you see may be a linux shell. See what you find about wget.exe and it's parameterisation.

Bye, Olaf.

Also why use wget at all? HTTP requests and FTP can be done using other FLLs and OLE classes and Windows API calls. We already had that topic, today. Didn't we?

PS: Downloaded wget and looked into it's doc wget.chm: Yes, it's the wget owns window, not cmd.exe, so the foxrun.pif has no influence whatsoever. Try the -q option. You might still get a command like window without any output in it.
0
 

Author Comment

by:formadmirer
ID: 38389123
You're right. But for this particular application wget is already in place and has worked great except for the dos window.

As far as a linux shell I think that may be part of it. wget includes a window suppression switch, but even with it on the window still appears.
0
 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 38389131
Well, then that switch is not working, is it? What does the windows title bar tell if you do a lengthy FTP wget?

Bye, Olaf.
0
 

Author Closing Comment

by:formadmirer
ID: 38389250
I am moving on as I do have to implement ftp here shortly and I will revisit this issue at that time and do away with wget altogether.<br />Thanks for all the help.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Integration Management Part 2
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question