Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Script finds file - loses file
Message
De
21/01/2004 09:13:27
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00868491
Message ID:
00868953
Vues:
14
You nailed it - Thanks

>Don,
>
>Because of the spaces in the directory name, it has to be enclosed in the double quotes. Try
oShell.Run(CHR(34) & cLocal & cExe & CHR(34))
>
>
>
>>I have written the following windows script to update minor revisions in my application automatically.
>>
>>This script is called to run before the application to see if a newer version is available. If it is it is copied to the user's directory and run. Script checks if exe exists, if not it copies the remote version to the local directory. If it exist the DateLastModified is checked and if different the remote version is copied to the the local.
>>
>>All of this works. The only line that doesn't is the last which trys to run the local version. I get a file not found error. This after the script found the same file at once or twice before.
>
>>Dim oFSO,oLocal,oRemote,cExe,cLocal,cRemote,oShell,cParm
>>cExe = "proplan80.exe"
>>cLocal = "C:\Program Files\Humboldt Wedag\Proplan\"
>>cRemote = "\\hwi5\vol4\PROPLAN\"
>>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)
>
Best Regards
Don Simpson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform