under registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths (64-bit applications on 64-bit Windows, 32-bit applications on 32-bit Windows) or HKEY_LOCAL_MACHINE\Software\ Wow6432Node \Microsoft\Windows\CurrentVersion\App Paths (32-bit applications on 64-bit Windows). Most applications are installed for all users using the special trusted installer account or an administrator account and therefore register the installed application in registry hive of local machine, i.e. The registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths does by default not exist. There is additionally checked if there is next nothing under key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths in which case this empty registry key is also deleted to restore the initial registry data completely. In case of UltraCompare Professional Portable on USB stick is indeed currently registered in registry hive of current user, the registry key is deleted by this batch file. Otherwise the batch file execution is exited as there is an application registration of UltraCompare on the host machine which was not done by RegUC.cmd. ![]() This batch file first checks if the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\uc.exe exists and the default string value has the string which is stored in RegUC.cmd. Please note that the part Path\UltraCompare\ucp.exe in the second command line must be adapted with correct path and file name of the executable of UltraCompare Professional Portable on the USB stick. %SystemRoot%\System32\reg.exe DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths" /f >nul 2>nul ![]() %SystemRoot%\System32\reg.exe DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\uc.exe" /f >nul 2>nulįor /F "delims=" %%I in ('%SystemRoot%\System32\reg.exe QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths" 2^>nul') do exit /B %SystemRoot%\System32\reg.exe QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\uc.exe" /ve 2>nul | %SystemRoot%\System32\find.exe /I "%~d0\Path\UltraCompare\ucp.exe" >nul || exit /B The second batch file is UnRegUC.cmd with following command lines: If there is by chance already an application registration for UltraCompare Professional in registry hive of current user on host machine, this application registration is kept as is. This batch file first checks if there is no registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\uc.exe and if this condition is true, it adds the registry key with the default string value being the fully qualified file name of the executable of UltraCompare Professional Portable on the USB stick. There is registered uc.exe (non-portable UltraCompare Professional) with the fully qualified file name of UltraCompare Professional Portable as that is the registry key searched also by UltraEdit Portable according to the information provided in the first post of this topic. So the drive letter assigned by Windows to the USB stick is used automatically on registering UC. ![]() %~d0 references drive letter and colon of the batch file containing this line. Please note that the part Path\UltraCompare\ucp.exe in the command line must be adapted with correct path and file name of the executable of UltraCompare Professional Portable on the USB stick. The first batch file is RegUC.cmd with just one long command line:Ĭode: Select all QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\uc.exe" >nul 2>nul || %SystemRoot%\System32\reg.exe ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\uc.exe" /f /ve /t REG_SZ /d "%~d0\Path\UltraCompare\ucp.exe" >nul There are two batch files required both stored also on the USB stick and executed from the USB stick. It is of course possible to manually do a temporary registration of UltraCompare Professional for current user only so that UltraEdit Portable recognizes UltraCompare Professional Portable. For that reason there is no application registration done on the computer on which the portable versions are executed from the USB stick. The portable versions are used without the execution of an installer on the machine on which the USB stick with the executables is plugged in. The application registration is done by the installers of UltraCompare, UltraEdit, UEStudio. UltraEdit detects the availability of UltraCompare Professional by existence of its application registration. I tested my solution with the non-portable versions UltraEdit and UltraCompare Professional. I have to mention first that I have neither UltraEdit Portable nor UltraCompare Portable and so could not test my solution with these two applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |