I'm surprised you didn't find that command
IF NOT ACCESS2000RunTimeInstallation RUN ACCESS2000RuntimeInstallation
;-)
But anyhow,
Here is the principle.
I have a file called a.a and a directory called c:\windows. I don't have a file called a.b and I don't have a directory called c:\windows1
One can say
if exist a.a c:\program\program.exe
In the examples below, you can replace "echo here", with the path of a program
Now find out what files the access 2000 installation thing puts in the hard drive and pick a unique one, or a directory it makes, and use that for your IF statement.
C:\>if exist a.a echo here
here
C:\>if exist a.b echo here
C:\>if exist c:\windows\nul echo here
here
C:\>if exist c:\windows1\nul echo here
C:\>
Update-
You can also check the registry
As an example, whatever the program, one place you might see the thing is in Add/Remove programs. Here is the place in the registry where that is stored. You can run that command and scroll through that just to get an idea of the command
C:\>reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Unins
tall | more
One program listed is Windows Media Player, which you'd have too
C:\>reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Unin
stall\Windows Media Player"
! REG.EXE VERSION 3.0
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Windows M
edia Player
DisplayName REG_SZ Windows Media Player 10
UninstallString REG_SZ "C:\Program Files\Windows Media Player\Setup_wm.
exe" /Uninstall
DisplayIcon REG_SZ C:\Program Files\Windows Media Player\wmplayer.exe
ParentKeyName REG_SZ OperatingSystem
ParentDisplayName REG_SZ Windows Updates
C:\>
That "successful" reg query command sets ERRORLEVEL to 0, meaning no error.
C:\>echo %errorlevel%
0
If the key didn't exist e.g. I look for Windows Media Playerr (notice the extra r)
C:\>reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Unin
stall\Windows Media Playerr"
Error: The system was unable to find the specified registry key or value
C:\>echo %errorlevel%
1
C:\>
When %errorlevel% is >=1 then it means error.
So you can test IF %errorlevel%==0 You can test IF NOT %errorlevel%==0
You can use an ELSE
The other syntax for testing ERRORLEVEL, don't do if errorlevel 0 (silly) 'cos that asks the value is >=0. You say IF ERRORLEVEL 1 (i.e. if the value is >=1) , or IF NOT ERRORLEVEL 1 (i.e. if the value is not >=1 i.e. if the value is 0 or less - and I doubt it could ever be less). Or you use the %errorlevel%.
wmic is a nice idea. But AFAIK wmic is not available by default on Windows XP. – Robert – 2012-04-26T15:17:25.417
@Robert It isn't? Ok, scrap this idea then. Checking the registry, perhaps the uninstall keys, would be the way to go then. – Bob – 2012-04-26T22:23:17.327
I checked the availability of WMIC on XP and I have to say that I was partly wrong. WMIC came with SP2 but it is only installed if it is an XP Professional version. Therefore WMIC is only unavailable on XP Home. – Robert – 2012-04-27T08:08:09.573