I have the following script that has worked on several Windows XP machines for 6 months, but fails at line 18 (FSO.CopyFile...) on Windows 2000. It may not be 2000 related, but I suspect it is. The 2000 user has the full admin rights that I do, so I am a bit lost. Can anyone help?!
Thanks, Keith
'Start
Dim strOldPath
Dim strNewPath
Dim FSO
strOldPath =left(wscript.scriptfullname,len(wscript.scriptfullname)-len(wscript.scriptname)) & "syrondb.mdb"
strNewPath ="\\syron-ns-01\Public\Software\Database_Front_Ends\SyronDatabase\syrondb.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.
WScript.Sleep 1000
loop
Set WshShell = WScript.CreateObject("WScript.Shell")
FSO.CopyFile strNewpath,strOldPath,True
WScript.Sleep 5000 'wait while file is copied
msgbox "update complete"
wshshell.run "MSACCESS.EXE " & Chr(34) & strOldPath & Chr(34)
'End
Thanks, Keith
'Start
Dim strOldPath
Dim strNewPath
Dim FSO
strOldPath =left(wscript.scriptfullname,len(wscript.scriptfullname)-len(wscript.scriptname)) & "syrondb.mdb"
strNewPath ="\\syron-ns-01\Public\Software\Database_Front_Ends\SyronDatabase\syrondb.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.
WScript.Sleep 1000
loop
Set WshShell = WScript.CreateObject("WScript.Shell")
FSO.CopyFile strNewpath,strOldPath,True
WScript.Sleep 5000 'wait while file is copied
msgbox "update complete"
wshshell.run "MSACCESS.EXE " & Chr(34) & strOldPath & Chr(34)
'End