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!

exe run bat 2

Status
Not open for further replies.

andrejanubis

Programmer
Jun 10, 2008
10


I would like to make test.exe vithe FoxPro 8 that will run extern test.bat
can you help
I am new at this
I thak you for any help
 
Don't forget that since it's a batch file, you'll need to really call the command-interpreter.

Code:
<COMSPEC> /C EXTERN.BAT

----------
Measurement is not management.
 
Thank you
So in the above link I have to change the line:
c:\\winnt351\\system32\\notepad.exe
?


and
<COMSPEC> /C EXTERN.BAT
what is '/C' for?
 
Thank you, but I have a problem. THis is wat I have:

Code:
DECLARE INTEGER ShellExecute ;
     IN SHELL32.DLL ;
     INTEGER nWinHandle,;
     STRING cOperation,;
     STRING cFileName,;
     STRING cParameters,;
     STRING cDirectory,;
     INTEGER nShowWindow

ShellExecute( 0, "Open", "WFTV.bat", "", "", 1 )

It works OK on comp that I have FoxPro, but I need it on second and that is whare I get that "MSVCR70.dll" is missing. When I provide that I get "Cannot locate the Microsoft Visual FoxPro support library." How can I fix it. Please don't tell me to install there FoxPro. I is not an option.
For any help I would be thankful!
 
I'm not sure which file it's looking for, but what I always recommend people to do when they run into this problem is fire up Process Monitor. It's a free utility from microsoft that will allow you to see what resources your application are calling at run time and where the application is expecting it to be.

In addition to this, Dependency Walker (installed with visual studio) will produce a tree of all files that are needed for your application to run. You just go down the list and find all of the ones that you need.

Now, as I stated previously, I'm not REAL familiar with FP...but is there an install package that you can set up so that it will automatically get all of the files you need? In other languages, the setup package will scan your app and pull in all files that are needed and include them in the package.

im in ur stakz, overflowin ur heapz!
 
ok, now it works . Thank you all.

But on my second comp (that doesn't have installed FoxPro) window that I run closes immediately. I have an idea that will fix it.
 
I give up.
I have don't have *.bat any more. All I have is a line:
Code:
RUN 'C:\WINDOWS\system32\cmd.exe /c start "Title" /AboveNormal C:\WINDOWS\notepad.exe'
When I run it I get a message:
No PARAMETER statement is found.

And three options:
Cancal Ignore Help

If I press Cancel it closes.
If I press Ignore starts the program (just what I want!) - can I make it go around this?
If I press Help nothing hepens. I assume because I don't have FoxPro on that comp.

If I go with:
Code:
DECLARE INTEGER ShellExecute IN SHELL32.DLL ;
     INTEGER nWinHandle, ;
     STRING cAction, ;    
     STRING cFileName, ;  
     STRING cParameters, ;
     STRING cDirectory, ; 
     INTEGER nShowWindow  
     
cAction = "Open"
cFileName = "C:\Programs\WFTVFM\WFTV.bat"
ShellExecute( 0, cAction, cFileName, "", "", 2 )

WFTV.bat has:
Code:
start "title" /AboveNormal "C:\WINDOWS\notepad.exe"

Same thing hapens only that when I click Ignore another error occurs:
File 'shellexecute.prg' does not exist.
No matter what I click here (Cancel or Ignore) it closes.

All I would like to do is to make an *.exe that would start notepad in 'AboveNormal' priority.


Any ideas, PLEASE?
 
What is start?

What happens if you put
start "title" /AboveNormal "C:\WINDOWS\notepad.exe"
in Run window of Start Menu?

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
Microsoft MVP VFP
 
Code:
start
is a batch command

command:
Code:
start "title" /AboveNormal "C:\WINDOWS\notepad.exe"
starts notepad in AboveNormal priority
 
Could you do this that way:
1. Press Start Button.
2. Press Run from Menu
3. type [start "title" /AboveNormal "C:\WINDOWS\notepad.exe"]
4. Press Enter
Just because I can't.



Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
Microsoft MVP VFP
 
OK...I did some research on the start command. I think you'll be better off running the notepad directly from the createprocess method. Essentially, what you're doing is wrapping the executable with a batch file, then wrapping the batch file with an executable. Just go from executable to executable.

im in ur stakz, overflowin ur heapz!
 
How do I run:

Code:
start "title" /AboveNormal "C:\WINDOWS\notepad.exe"

in createprocess
 
How do I run:
Code:
start "title" /AboveNormal "C:\WINDOWS\notepad.exe"
in ShellExecute
 
I have

Code:
DECLARE INTEGER CreateProcess IN kernel32;
    STRING   lpApplicationName,;
    STRING   lpCommandLine,;
    INTEGER  lpProcessAttributes,;
    INTEGER  lpThreadAttributes,;
    INTEGER  bInheritHandles,;
    INTEGER  dwCreationFlags,;
    INTEGER  lpEnvironment,;
    STRING   lpCurrentDirectory,;
    STRING   lpStartupInfo,;
    STRING @ lpProcessInformation
    
cApp = "C:\WINDOWS\notepad.exe"

cStartInfo = long2str(68) + REPLICATE(CHR(0), 64)
cProcInfo = REPLICATE(CHR(0), 16)

= CreateProcess( cApp, NULL, 0, 0, 0, 0, 0, SYS(5)+SYS(2003), @cStartInfo, @cProcInfo )

FUNCTION long2str
      PARAMETERS m.longval

      PRIVATE i, m.retstr

      m.retstr = ""
      FOR i = 24 TO 0 STEP -8
         m.retstr = CHR(INT(m.longval/(2^i))) + m.retstr
         m.longval = MOD(m.longval, (2^i))
      NEXT
      RETURN m.retstr

and

Code:
DECLARE INTEGER ShellExecute IN SHELL32.DLL ;
     INTEGER nWinHandle, ; && handle of the program's parent window, usually set this to 0
     STRING cAction, ;     && action to be performed
     STRING cFileName, ;   && file on which the action is to be performed
     STRING cParameters, ; && If the file is an executable program, these are the parameters (if any) that are passed to it in the command line
     STRING cDirectory, ;  && If the file is an executable program, this is the program's default or start-up directory
     INTEGER nShowWindow   && program's initial window state (1 = normal, 2 = minimized, 3 = maximized)
     
cAction = "Open"
cFileName = 'C:\WINDOWS\notepad.exe'

ShellExecute( 0, cAction, cFileName, "", "", 2 )
but how do I put
Code:
start "title" /AboveNormal
in
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top