Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VBS WSH command line parameter
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
VBS WSH command line parameter
Miscellaneous
Thread ID:
00548253
Message ID:
00548253
Views:
38
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 )
Next
Reply
Map
View

Click here to load this message in the networking platform