Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Some of our computers run multiple versions of Microsoft Access (97 & 2010) while others run 365. For the pcs running multiple versions, the default is set to 97. I have a batch file that is performing various tests to see if files exist, and finished by running an Access 2010 database called MWO.accdb. See below.

if exist c:\windows\system32\mscomct2.ocx goto step2

rem copy mscomct2 and register
cscript \\file\apps\Database\Maintenance\365\MsgBox.vbs "Preparing necessary libraries."
copy "\\file\apps\Database\Maintenance\365\mscomct2.ocx" "c:\windows\system32\"
regsvr32 /u mscomct2.ocx
regsvr32 /i mscomct2.ocx

:step2

if exist "%USERPROFILE%\Desktop\MWO.lnk" goto step3

rem create shortcut on user's desktop for future use
cscript \\file\apps\Database\Maintenance\365\MsgBox.vbs "Creating shortcut on desktop & adding to start menu."
copy "\\file\apps\Database\Maintenance\MWO-INSTALL.lnk" "%USERPROFILE%\Desktop\MWO.lnk"
mkdir "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Maintenance"
copy "\\file\apps\Database\Maintenance\MWO-INSTALL.lnk" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Maintenance\MWO.lnk"

:step3
\\file\apps\Database\Maintenance\365\MWO.accdb

Is there an easy way to test for the latest version of access, and force the file to open with it to avoid the defaulting to 97 problem?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.