I hope someone can help me with this. Basically I want to add this to my login script. The batch script needs to check if McAfee agent5 is installed. If its not exit. If it is installed to run the force install form the network share. I have used the location where agent5 gets installed. I am not sure if there is a way to check the installed version instead? The reason I cannot do this from EPO is I cant downgrade? Agent5 blocks it, unfortunately. This is what I have but it does not work? Serial experiments lain ost rar files on mac. If you found someone breaking our terms of serive please report HOW DO I GET STARTED? How To Upload a File? Refer to our home page and register a free account. Yes,File Upload is completely free to join, How to report abuse? ![]() I have a batch script which runs at logon (with elevated privileges) that should run only if a specific program version is installed. I'm not able to check the 'Program Files' directory because it doesn't get installed there. However, I'm able to see it under installed applications. Feb 18, 2014 - If requiring the installation of extra tools is ok, there's a where command. As an internal or external command, operable program or batch file. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |