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:
00548394
Vues:
19
This message has been marked as the solution to the initial question of the thread.
Hi John,

You can use WshArguments Object through it's Arguments property.
Set objArgs = WScript.Arguments
cExe = objArgs(0)
cLocal = objArgs(1)
cRemote = objArgs(2)
You can get the number of parameters using objArgs.Count().

>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 )
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform