Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fox 2.6 Closing inactive foxpro run command window 1

Status
Not open for further replies.

jlg13

Technical User
May 10, 2001
61
US
Hi Experts,

It's been a while since my last post but have several coming your way...

I have recently installed Fox 2.6 on a windows 10 32bit virtual machine.

in my new environment, I seemed to have a lost a setting where an inactive FoxPro Run Command screen would close automatically. Now I have to click the X in the upper right or click the upper left corner to open a menu window and select close to manually close the window. In this particular sequence, I have to do that twice as it involves deleting files and executing a zip of files, 2 separate dos commands.

thoughts appreciated

Joe

 
No idea what you're talking about.

What if you post some screenshots of your situation. Just click the Image tool in the Reply section and follow the instructions.

Chriss
 
InactiveFPWiindow_p4jvdg.jpg



Sorry for the confusion... In a program, i am executing some commands that deletes files and also backs up files to a zip. When the command executes, the Run Command window opens as shown. This closes automatically when the command is completed in my Windows XP environment. In my Win 10 32 bit environment, it does not. I was wondering if anyone had this issue but found a solution
 
To me it looks like your code is stuck and doesn't finish, therefore the window becomes inactive, but not because you finished.

Chriss
 
Hi Chris, I am not sure about that...

My dad was the original programmer, but here's what I know...

The program executes this bat file using the command RUN LM_BKUP.BAT

It executes the following

DEL BACKUP\BACKUP.ZIP
DEL *.BAK
DEL *.TBK
DEL *.ZIP
DEL *.TXT
DEL *.CSV
WZZIP BACKUP\BACKUP.ZIP C:\FOXPROW\USA\PPSMA\LM_*.*

The image shows file not found as it did not find any of the above extensions to DELETE.

It executes the winzip command and the zip is created

Then the above DOS window hangs open as inactive. It closes automatically in my other environment, using same program.

 
This is not even foxpro, this is just shell commands, the only Fox command is the Run.

I think you'd be better of on a more recent Windows version to use the file extension cmd, not bat.

If I run a bat file on Windows 10 Windows comes up and offers to look for an app for bat files. This has changed in Windows, not in Foxpro.

And the window you show is an OS window. Change the file extension to cmd instead of bat and you'll see it works and closes after finishing.
I can even imagine the reason a bat extension still works. Partly because it's the old etension for batch files, partly because FoxPros Run command is very closely related to starting a Windows Shell and running a batch/text file it executes the shell commands. If you Run an EXE, for example, you also get a short blink of a shell window that finally starts the EXE.

So Run in itself is causing a Shell Window to open. Whether it closes or not is perhaps a setting you can do in Windows somewhere, but not in FoxPro.

Chriss
 
I will give that a try Chriss. thanks. I will circle back with results in a day or 2
 
Okay, one more thing just came to me. The bridge between FoxPro and the OS regarding what the RUN command does is a file FoxRun.pif somewhere in the Foxpro installation directory.
It's starting command.com, but the usual OS command shell now is cmd.exe since a long long time. You might be adressing that pif file, too.
You'll find more on that file in the Foxpro help. In VFP9 this still exists, but plays no role for Windows Vista or higher. Anyway, if I run a cmd batch file the shell window closes after the script finishes.

Chriss
 
CHRISS!

That was it! the PIF file.

So, it was KILLING me because I swear there was a close on exit option and I checked the properties of the bat file... and a few other places. My eventual thought was that Win 10 took that away but your message about the PIF struck a memory... and its weird too because the file doesn't show foxrun.pif with the extension, it identifies as a shortcut to MS-DOS program. THAT, I right clicked, selected program tab and viola... Once I checked that, I reran the code and the windows closed. Sorry I did a poor job of explaining. The fox program my dad made, creates the bat file and then run's it. the "code" i sent over were the contents of the bat file and I should have specified that (novice here). Thanks for giving this some of your thinking minutes, the after thought lead to success. APPRECIATED!

foxrun.pif_h07xmi.jpg
 
Yes, but that still is not what you should use on Windows 10 anymore - Comand.com. cmd.exe is the shell of windows since a few versions.

The help on VFP says VFP now determines wht RUN uses by the OS environment variable %COMSPEC%, and that's cmd.exe

In Windows10 I cant even edit a PIF file like that anymore, I can only see it contains command.com by looking into it as binary file with a hex editor. Windows 10 shows a pif file as if it was a shortcut (.lnk file), which it kind of is. The compatibility has dropped about this.

I recommend you try this: Rename Foxrun.pif to _Foxrun.pi_, then see what the run command starts. You may edit the COMSPEC environment variable to command.com to check whether also Foxpro 2.6 then uses the COMSPEC environment setting. You lose the ability to determine that close on exit flag. But it's standard for the cmd.exe

You could also use RUN /N to get this even more into your control, you can RUN /N cmd.exe /K scriptfile to keep it open and RUN /N cmd.exe /C scriptfile to close the shell window. Keeping the shell window open can be handy to check things after the script executed.

Just try to get independent from a pif file, the OS doesn't support it fully anymore. And all RUN does in the end is start command.com or cmd.exe, RUN /N is more like a create any process, but can of course be used to create one of these, too. I'm not sure FoxPro 2.6 has RUN /N, but I think it does. One other difference is the /N also stands for nowait, so FoxPRo doesn't wait for the process started to exit.

Chriss
 
ok, I will give that a try. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top