Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I want to run a .vbs file from within a Fox prg
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00636047
Message ID:
00636170
Vues:
20
>>>>I want to run a .vbs file from within a Fox prg. The RUN /N command will not run my vbscript file. I tried calling the .vbs from a batch file and that doesn't seem to work. Any ideas?
>>>
>>>Try
RUN /n cscript myscript.vbs
>>
>>Sergey,
>>
>>Better would be to use wscript instead. The cscript executable is for running scripts from console, rather than Windows.
>
>Ok, you got my attention. :) Can you explain why it's better?
>BTW, I think it's better to run it thru WSH object as you suggested in the other post.

With cscript.exe the anticipated output is directed to an MS-DOS window (the console). Wscript, however, utilizes some graphical capabilities that cscript cannot. IOW, the output engines are different.

There are several reasons why I tend to suggest the Shell's Run method over the native VFP RUN command. First, since it wraps a call to ShellExecute or ShellExecuteEx, you just pass it the file name and don't have to be concerned over what application the file is associated with. Another is the ability to wait for the other application to terminate prior to executing any following code. This can be especially useful when, say, using a script to copy either a lot of files or a very large one.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform