user336598776 / Convert-Sandboxie-RegHive-to-reg-file

using reg.exe and binmay.exe to convert Sandboxie "RegHive" file to reg(text) file on Windows XP/7/10/11.
5 stars 0 forks source link

Rename RegHive_reg.txt to RegHive_reg.reg #1

Open lwcorp opened 2 years ago

lwcorp commented 2 years ago

Since REG files use a REG file extensions (e.g. they're clickable this way), will you consider renaming them as such?

user336598776 commented 2 years ago

you'd better pick something useful up and save it to new reg file.

cause there're something useless in exported "RegHive_reg.txt" file.

e.g. #1 useless: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket] [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume] [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume{x-x-x-x-x}] "NukeOnDelete"=dword:00000001

e.g. #2 useless: [HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache] "C:\Program Files\Sandboxie\SandboxieRpcSs.exe"="Sandboxie COM Services (RPC)" "X:\x\x.exe"="x"

e.g. #3 useless: [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\x] "SBIE_CurrentState"=dword:00000004 "SBIE_StartTicks"=hex(786f6273): "SBIE_ControlsAccepted"=dword:00000085 "SBIE_Win32ExitCode"=dword:00000000 "SBIE_ServiceSpecificExitCode"=dword:00000000 "SBIE_CheckPoint"=dword:00000000 "SBIE_WaitHint"=dword:00000000 "SBIE_ProcessId"=dword:0000172c

lwcorp commented 2 years ago

Could the program remove it before renaming to REG?

user336598776 commented 2 years ago

Could the program remove it before renaming to REG?

no, it can't.

reg.exe

binmay.exe

lwcorp commented 2 years ago

The BAT itself can do it via PowerShell, VBS or echo commands - see https://stackoverflow.com/questions/60034/how-can-you-find-and-replace-text-in-a-file-using-the-windows-command-line-envir

user336598776 commented 2 years ago

The BAT itself can do it via PowerShell, VBS or echo commands - see https://stackoverflow.com/questions/60034/how-can-you-find-and-replace-text-in-a-file-using-the-windows-command-line-envir

cause "binmay.exe" is easy to use and support Unicode,WinXP

PowerShell doesn't work on WinXP(Sandboxie v5.22).

vbs is complicated and i get some error(doesn't work).

bat echo command only works in ANSI(not Unicode reg).

lwcorp commented 2 years ago

PowerShell doesn't work on WinXP(Sandboxie v5.22).

I must assume there aren't a lot of users who stick to Widows XP, use old Sandboxie and know about your program. But for the benefit of the doubt, you can simply check if PowerShell exists. If it does, use it to create a REG file. If it doesn't, create the regular unmodified TXT file like now.

In other words, put this in your BAT file: for %%i in (powershell.exe) do if "%%~$path:i"=="" (inside these brackets use PowerShell to create a REG file) else continue like now and create a TXT file Credit to How to check if powershell is installed?.

user336598776 commented 2 years ago

here is powershell version, but it's too slow and not work on WinXP. powershell_RegHive_to_reg.zip