Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Script finds file - loses file
Message
From
21/01/2004 09:13:27
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00868491
Message ID:
00868953
Views:
15
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform