Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VBS WSH command line parameter
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00548253
Message ID:
00549132
Vues:
19
This message has been marked as a message which has helped to the initial question of the thread.
>Hello all,
> I don't think I'm posting this in the right place, or even in the right forum, but I know GT can help if nothing else :-) Anyway, I'm using the WSH as a loader utility for my VFP .EXE's and was wondering how to pass a command line parameter to the VBS. Example code below, hopefully this is explained well enough. Thanks folks.
>John
>
>
>Dim oFSO, oLocal, oRemote, cExe, cLocal, cRemote, oShell, cParm
>
>'cExe = "MyExe.exe"
>cExe = PARAMETER1
>
>'cLocal = "C:\LOCAL\"
>cLocal = PARAMETER2
>
>'cRemote = "H:\REMOTE\"
>cRemote = PARAMETER3
>
>cParm = ""
>Set oFSO = CreateObject( "Scripting.FileSystemObject" )
>Set oShell = CreateObject( "WScript.Shell" )
>Set oRemote = oFSO.GetFile( cRemote & cExe )
>If Not oFSO.FileExists( cLocal & cExe ) Then
>  oRemote.Copy cLocal
>Else
>  Set oLocal = oFSO.GetFile( cLocal & cExe )
>  If oRemote.DateLastModified > oLocal.DateLastModified Then
>    oRemote.Copy cLocal
>  End if
>End if
>oShell.Run( cLocal & cExe & cParm )
>
John,

Sorry I missed this earlier. Sergey's answered your questions, so let me give you some information on resources. Last September, in the VFUG newsletter, Ed Rauh and I began a series on using the WSH from within VFP. While this code is in VBScript, the first installment of the series deals with where to find more information (among other things). The articles are available on-line at www.vfug.org

One more note...The MSDN Library has a lot of info on scripting.
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