'present a message box so that the user knows "something" is happening with this vbscript
'make sure the user has a folder in their appdata, to hold the database
'copy the latest network file into that folder
'open that file
dim strAppDataFolder, strFullPathToDatabaseFolder, fso, AccessApp
msgbox "Press OK to open the Database",vbInformation," "
set fso=createobject("scripting.filesystemobject")
strAppDataFolder=CreateObject("wscript.shell").specialfolders("AppData")
strFullPathToDatabaseFolder=strAppDataFolder & "\Database"
'remove whole user's local folder if it exists
if fso.folderexists(strFullPathToDatabaseFolder)=true then
fso.deletefolder(strFullPathToDatabaseFolder)
end if
fso.createfolder strFullPathToDatabaseFolder
fso.copyfile "\\server\folder\DatabaseName.accdr",strFullPathToDatabaseFolder & "\DatabaseName.accdr"
set AccessApp = createobject("Access.Application")
dim strRun
strRun = strFullPathToDatabaseFolder & "\DatabaseName.accdr"
CreateObject("WScript.Shell").Run """" & strRun & """"