I have the following code to facilitate updating a front-end of a database. It runs fine until it tries to open the file (errors out at line 29) "wshshell.run strOldPath" saying the "System cannot find the file specified". Any ideas as to why?
Thanks!
Thanks!
Code:
'Start
Dim strOldPath
Dim strNewPath
Dim FSO
strOldPath=left(wscript.scriptfullname,len(wscript.scriptfullname)-len(wscript.scriptname)) & "adfe.mdb"
strNewPath ="\\syron-ns-01\Public\Software\Database_Front_Ends\Applications\adfe.mdb"
Set FSO = CreateObject("Scripting.FileSystemObject")
do while FSO.FileExists(Left(strOldPath, len(strOldPath)-3) & "ldb")=True
'As long as an ldb file exists, someone is in the database, so just do nothing until it goes away.
loop
Set WshShell = WScript.CreateObject("WScript.Shell")
FSO.CopyFile strNewpath,strOldPath,True
WScript.Sleep 10000 'wait while file is copied
wshshell.run strOldPath
'End