loFSO = CREATEOBJECT("Scripting.FileSystemObject") loWSHNet = CREATEOBJECT('Wscript.Network') IF !loFSO.FolderExists(ADDBS(lcDriveLetter) + lcRemotePath) llError = .F. ON ERROR llError = .T. IF !loWSHNet.MapNetworkDrive(lcDriveLetter, lcServerName + lcRemotePath, .t.) ON ERROR * could not map drive MsgSvc("Could not map drive!", lcDriveLetter + "~" + lcServerName) RELEASE ALL RETURN .F. ENDIF ON ERROR IF llError = .T. MsgSvc("Could not map drive!", lcDriveLetter + "~" + lcServerName) RELEASE ALL RETURN .F. ENDIF llError = .T. ENDIFQ: How do you test for WSH being installed in your a post-setup executable? Do you try to instantiate with CREATEOBJ()?
Dim oFSO, oLocal, oRemote, cExe, cLocal, cRemote, oShell, cParm >cExe = "My_app.EXE" >cLocal = "C:\VFPLOCAL\" >cRemote = "F:\VFPREMOTE\" >cParm = " -cC:\VFPLOCAL\My_app.fpw" >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)Pretty simple and straight forward I think.