Running an exe file that is invoked with a Batch file



Question:

Hi,
I tried to load a FoxPro for DOS exe file into vista that has been running quite well on a XP machine for some time.   Since I will now be using a  USB printer  (epson stylus photo rx580)  I need to run a batch file to initiate  “net use LPT1 \\<computer name>\ <printer name> then place the batch file on the desktop (the batch file will invoke my foxpro exe file also).  Will I each time I want to run the batch file have to right click it and then click <run as administor> ?
On just running the exe file  it loaded a foxuser.dbf file on the desktop each time. Is this normal and can I prevent this?

Answer:

Hiya, Jack.

You can configure a batch file to always run as an administrator (after a UAC prompt, of course) by creating a shortcut to it and then configuring that shortcut to run as an administrator, as I described in the article “Always Run A Batch File As An Administrator”.

FoxPro is creating the FoxUser.dbf file on your desktop because it automatically uses the current directory. Because you’re running it from the desktop, that’s where it’s saving the user settings file. If I were you, I’d just move the batch file to a different directory (say, “C:\Program Files\FoxPro\”), and then create a shortcut to the batch file on the desktop–that should fix the problem. Or, you could just ignore the FoxUser.dbf file.

  • RSS
  • email
  • Facebook
  • Twitter
  • Digg
  • del.icio.us
  • Google Bookmarks

One Response to “Running an exe file that is invoked with a Batch file”

  1. Vicky says:

    my HP Windows Vista laptop is stuck in a constant shutting down mode. It won’t shut off no matter what I do…unplug, turn off, cntrl alt delete…it has been stuck for days. Prior to that…I have never had a problem. Does anyone know what to do or have an idea what it could be?

Leave a reply