×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Fox 2.6 Closing inactive foxpro run command window

Fox 2.6 Closing inactive foxpro run command window

Fox 2.6 Closing inactive foxpro run command window

(OP)
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

RE: Fox 2.6 Closing inactive foxpro run command window

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

RE: Fox 2.6 Closing inactive foxpro run command window

(OP)



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

RE: Fox 2.6 Closing inactive foxpro run command window

To me it looks like your code is stuck and doesn't finish, therefore the window becomes inactive, but not because you finished.

Chriss

RE: Fox 2.6 Closing inactive foxpro run command window

(OP)
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.

RE: Fox 2.6 Closing inactive foxpro run command window

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

RE: Fox 2.6 Closing inactive foxpro run command window

(OP)
I will give that a try Chriss. thanks. I will circle back with results in a day or 2

RE: Fox 2.6 Closing inactive foxpro run command window

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

RE: Fox 2.6 Closing inactive foxpro run command window

(OP)
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!

RE: Fox 2.6 Closing inactive foxpro run command window

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

RE: Fox 2.6 Closing inactive foxpro run command window

removed


RE: Fox 2.6 Closing inactive foxpro run command window

(OP)
ok, I will give that a try. Thanks again.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close