Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Run command long file name
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Miscellaneous
Thread ID:
01148006
Message ID:
01148077
Views:
17
http://www.news2news.com/vfp/?example=2
apparently WinExec allows one to avoid using foxrun.pif. Seems to work just fine.
#DEFINE SW_HIDE 0 
#DEFINE SW_SHOWNORMAL 1 
#DEFINE SW_SHOWMINIMIZED 2 
#DEFINE SW_SHOWMAXIMIZED 3 
#DEFINE SW_SHOWNOACTIVATE 4 
#DEFINE SW_SHOW 5 
#DEFINE SW_MINIMIZE 6 
#DEFINE SW_SHOWMINNOACTIVE 7 
#DEFINE SW_SHOWNA 8 
#DEFINE SW_RESTORE 9 
#DEFINE SW_SHOWDEFAULT 10 

DECLARE INTEGER WinExec IN kernel32  STRING lpCmdLine, INTEGER nCmdShow 
LOCAL cCmdLine, nResult 

m1 = "c:\program files\newbie\newbie.exe" 
m2 = " /login admin /password asdfasdf" 
m3 = " /script c:\americanbulls.nbl"
m4 = " /autoclose true" 

m5 = (m1) + (m2) + m3 + m4

myCommand = m5

* for security reasons make sure the application name 
* is enclosed in quotation marks 
cCmdLine = myCommand

*!*    cCmdLine = "C:\Program Files\Microsoft Office\Office\WINWORD.EXE" 

nResult = WinExec(cCmdLine, SW_SHOWDEFAULT) 

IF nResult <= 31 
    = MESSAGEBOX("WinExec failed with an error: " +; 
        LTRIM(STR(nResult)) + "     ", 48) 
ENDIF  
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform