Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I pass a parameter to an exe file?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00788481
Message ID:
00788495
Vues:
28
As far as I know, this may be the only difference aside from the numerous other uses of the scripting host.

Windows 2000 logo Certification If you plan to submit your application for certification, you should not use the RUN command, because it can potentially violate the following System Group Policy requirement.

"RUN only allowed Windows application - your application must not start any application that is not on this list. Note this does not apply when launching applications through COM. If you use ShellExecuteEx, Windows 2000 will perform this check automatically."
Instead, you should use DECLARE DLL with ShellExecuteEx.API.


>Thanks Eric,
>
>Is there an advantage to using the loShell as opposed to just the Run command.
>Once I got edc.exe to convert 'T' to .T., I got this to work fine:
>cmdButton.click()
>RUN /N edc.EXE T
>
>What would be the advantage of using:
>cmdButton.click()
>loShell = createobject("WScript.Shell")
>loShell.Run("edc.exe T",1,.F.)
>
>>An exe can only accept a string and cannot contain spaces.
>>
>>In the exe:
>>
>>lparameters tcString
>>
>>if tcString == "T"
>>store .T. to myvar
>>endif && Otherwise whatever.
>>
>>Then in code:
>>
>>loShell = createobject("WScript.Shell")
>>loShell.Run("my.exe T",1,.F.) && Last param here is wait or nowait, second is windowstate
>>
>>
>>
>>find a way to pass a parameter to the exe file.
>>>>>
>>>>>I have tried "run /N edc.exe .T.", but it ignores the .T.
>>>>>I have tried "run /N edc.exe with .T." but I get an error
>>>>>
>>>>>TIA
>>>>
>>>>See How to pass parameters to VFP EXE FAQ #17861
>>>
>>>Hi Sergey,
>>>
>>>Your FAQ shows how to pass parameters using a Windows shortcut, but I can't get it to work from within a VFP 7.0 form.
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform