Issues executing a ".reg" file...

English support forum

Moderators: Hacker, petermad, Stefan2, white

User avatar
wanderer
Power Member
Power Member
Posts: 1640
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Issues executing a ".reg" file...

Post by *wanderer »

On a Win2K19 server, double-clicking on a ".reg" file:

- From Explorer: UAC window appears and when i press Yes, it asks to import the registry file and proceeds normally.
- From TC 11.01: I get an "access denied / application not found" message (even though my account is Local Admin on the server, i tried executing TC as plain user and "as admin", no difference)

Is there something that can be done in TC in order to behave like Explorer does?
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50471
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Issues executing a ".reg" file...

Post by *ghisler(Author) »

On Windows 10, opening .reg files on 64-bit Windows only works with 64-bit Total Commander, because regedit.exe is only present in the 64-bit system32 directory. It may be the same on Win2k19 server, or it may be a user restriction.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5780
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Issues executing a ".reg" file...

Post by *white »

2ghisler(Author)
How come it works with 32-bit TC if you drag the ".reg" file on the button bar an click the button bar?
User avatar
wanderer
Power Member
Power Member
Posts: 1640
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Re: Issues executing a ".reg" file...

Post by *wanderer »

ghisler(Author) wrote: 2023-09-08, 10:29 UTC On Windows 10, opening .reg files on 64-bit Windows only works with 64-bit Total Commander, because regedit.exe is only present in the 64-bit system32 directory. It may be the same on Win2k19 server, or it may be a user restriction.
Wow. Didn't occurr to me that this might be the case, so i went to the server and tried it again. TCx64 does not work (i get the message i reported), however with TCx32, everything worked fine. I'm guessing the version of regedit.exe in that windows setup is 32-bit.

Thanks for the input on this.

EDIT: regedit and regedt32 exist both in system32 and syswow64 folders. Is there a setting somewhere which chooses which version to use by default?
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
User avatar
white
Power Member
Power Member
Posts: 5780
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Issues executing a ".reg" file...

Post by *white »

ghisler(Author) wrote: 2023-09-08, 10:29 UTC On Windows 10, opening .reg files on 64-bit Windows only works with 64-bit Total Commander, because regedit.exe is only present in the 64-bit system32 directory.
On my Windows 11 system regedit.exe is in c:\windows\ (64-bit) and in c:\windows\SysWOW64\ (32-bit, visible in c:\windows\system32\ for a 32-bit application).

c:\windows\system32\cmd.exe command prompt (64-bit):

Code: Select all

C:\>dir c:\windows\regedit.exe c:\windows\system32\regedit.exe c:\windows\SysWOW64\regedit.exe 2>&1 | findstr /rc:"^[^ ]"
07-05-22  07:20           552.960 regedit.exe
File Not Found
07-05-22  07:20           487.936 regedit.exe
c:\windows\SysWOW64\cmd.exe command prompt (32-bit):

Code: Select all

C:\>dir c:\windows\regedit.exe c:\windows\system32\regedit.exe c:\windows\SysWOW64\regedit.exe 2>&1 | findstr /rc:"^[^ ]"
07-05-22  07:20           552.960 regedit.exe
07-05-22  07:20           487.936 regedit.exe
07-05-22  07:20           487.936 regedit.exe
My .reg association is :

Code: Select all

Registration Entries (regedit.exe "%1")
Notice no path is specified in the association for regedit.exe.
My path var starts with:

Code: Select all

PATH=C:\WINDOWS\system32;C:\WINDOWS;
When executing a .reg file in 32-bit cmd.exe, 32-bit regedit is executed (probably found via the path in c:\windows\system32\and redirected to c:\windows\SysWOW64\).
When executing a .reg file in 64-bit cmd.exe, 64-bit regedit is executed (probably found via the path in c:\windows\ because it was not found in c:\windows\system32\).

I got a File not found error when double clicking a .reg file in 32-bit TC. But no error when the file is executed via a button (but then 64-bit regedit is opened). Then I realized I have x64DisableRedirection=1 in my wincmd.ini and I added this button to TC:

Code: Select all

TOTALCMD#BAR#DATA
cm_SwitchX64Redirection

imageres.dll,109



2925
I clicked the button and then double clicking the .reg file worked and started 32-bit regedit. But the starting the .reg file via the button now gave the File not found error :) But after a restart, both worked and started 32-bit regedit.exe.
When I clicked the button again and restarted, both buttons still worked but executing the .reg file via the button started 64-bit regedit, while double clicking the .reg file started 32-bit regedit.

(BTW: Not relevant, but there seems to be a Windows bug with regedit.exe causing the last quote to be removed from the executed command line. But this doesn't seem to matter, regedit works OK without a closing quote of the passed filename.)

wanderer wrote: 2023-09-08, 11:01 UTC EDIT: regedit and regedt32 exist both in system32 and syswow64 folders. Is there a setting somewhere which chooses which version to use by default?
regedt32.exe executes 32-bit regedit.exe. The weird thing is, task manager shows 32-bit regedit is running and is started with command line "c:\windows\regedit.exe", but that file is the 64-bit version. It seems regedit is doing (weird) stuff with the command line in its environment space.

What was your error message exactly? What is your .reg association (you can easily check in Total Commander)? What does your path environment variable starts with? Where are your regedit.exe files located (check like I did)?
User avatar
Dalai
Power Member
Power Member
Posts: 9963
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Issues executing a ".reg" file...

Post by *Dalai »

Well, the command executed when double-clicking a file can be different between 32-bit and 64-bit programs. The exact command here is determined by these registry paths:

Code: Select all

HKLM\SOFTWARE\Wow6432Node\Classes\regfile\shell\open\command
HKLM\SOFTWARE\Classes\regfile\shell\open\command
The first one is for 32-bit programs, the second for 64-bit programs.

The difference between double-clicking and a button could be due to the functions called by TC - ShellExecute/ShellExecuteEx vs. CreateProcess - but that's just a guess.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
wanderer
Power Member
Power Member
Posts: 1640
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Re: Issues executing a ".reg" file...

Post by *wanderer »

Dalai wrote: 2023-09-08, 23:01 UTC

Code: Select all

HKLM\SOFTWARE\Wow6432Node\Classes\regfile\shell\open\command
--> This does not exist on my pc.

Code: Select all

HKLM\SOFTWARE\Classes\regfile\shell\open\command
--> This exists on my pc.
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
User avatar
wanderer
Power Member
Power Member
Posts: 1640
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Re: Issues executing a ".reg" file...

Post by *wanderer »

white wrote: 2023-09-08, 22:12 UTCWhat was your error message exactly?

Code: Select all

---------------------------
Total Commander
---------------------------
Access denied on file
<SNIP>
"Application not found"
---------------------------
OK   
---------------------------
white wrote: 2023-09-08, 22:12 UTCWhat is your .reg association (you can easily check in Total Commander)?
<Same as you describe>
white wrote: 2023-09-08, 22:12 UTCWhat does your path environment variable starts with?

Code: Select all

<Some stuff in Program Files>
%SystemRoot%\system32
%SystemRoot%
%SystemRoot%\System32\Wbem
<Some other stuff in Program Files>
white wrote: 2023-09-08, 22:12 UTCWhere are your regedit.exe files located (check like I did)?
<Same as you describe>

EDIT: Manually executing both regedit.exe's works fine.
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
User avatar
Dalai
Power Member
Power Member
Posts: 9963
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Issues executing a ".reg" file...

Post by *Dalai »

2wanderer
Does either of the following keys exist (with some content that makes sense)

Code: Select all

HKCU\Software\Classes\regfile
HKEY_CLASSES_ROOT\regfile
when you look at them from a 32-bit view? What does TC 32-bit show for Files > Associate With?

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6968
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Issues executing a ".reg" file...

Post by *Horst.Epp »

Dalai wrote: 2023-09-09, 13:55 UTC 2wanderer
Does either of the following keys exist (with some content that makes sense)

Code: Select all

HKCU\Software\Classes\regfile
HKEY_CLASSES_ROOT\regfile
when you look at them from a 32-bit view? What does TC 32-bit show for Files > Associate With?

Regards
Dalai
On Windows 11 only the 2nd one has a content.

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\regfile]
@="Registration Entries"
"EditFlags"=dword:00100000
"FriendlyTypeName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,\
  00,6f,00,6f,00,74,00,25,00,5c,00,72,00,65,00,67,00,65,00,64,00,69,00,74,00,\
  2e,00,65,00,78,00,65,00,2c,00,2d,00,33,00,30,00,39,00,00,00

[HKEY_CLASSES_ROOT\regfile\DefaultIcon]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,72,00,65,00,67,00,65,00,64,00,69,00,74,00,2e,00,65,00,78,00,65,00,\
  2c,00,31,00,00,00

[HKEY_CLASSES_ROOT\regfile\shell]

[HKEY_CLASSES_ROOT\regfile\shell\edit]

[HKEY_CLASSES_ROOT\regfile\shell\edit\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6e,00,6f,00,\
  74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,00,31,\
  00,22,00,00,00

[HKEY_CLASSES_ROOT\regfile\shell\open]
@="Mer&ge"
"MUIVerb"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,\
  6f,00,74,00,25,00,5c,00,72,00,65,00,67,00,65,00,64,00,69,00,74,00,2e,00,65,\
  00,78,00,65,00,2c,00,2d,00,33,00,31,00,30,00,00,00

[HKEY_CLASSES_ROOT\regfile\shell\open\command]
@="regedit.exe \"%1\""

[HKEY_CLASSES_ROOT\regfile\shell\print]

[HKEY_CLASSES_ROOT\regfile\shell\print\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6e,00,6f,00,\
  74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,20,00,2f,00,70,00,20,\
  00,22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\regfile\shellex]

[HKEY_CLASSES_ROOT\regfile\shellex\{8895b1c6-b41f-4c1c-a562-0d564250836f}]
@="{1531d583-8375-4d3f-b5fb-d23bbd169f22}"

Both TC versions show the same Windows Associate with entry
Registration Entries (regedit.exe "%1")
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.55 RC1 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6968
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Issues executing a ".reg" file...

Post by *Horst.Epp »

Made a short test with simply regedit.exe on a button.
This button can successfully start regedit.exe in Both TC versions, after the UAC prompt.
Using this button in TC 32bit executes a 32bit regedit.exe from C:\Windows
Using x64 TC it runs a x64 regedit.exe from C:\Windows\SysWOW64
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.55 RC1 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
User avatar
HerbieH
Member
Member
Posts: 154
Joined: 2003-02-11, 10:04 UTC

Re: Issues executing a ".reg" file...

Post by *HerbieH »

I have made the following extensive .reg-file /regedit tests:

Operating system:
Windows 10 (x64) proff. ver. 22H2 with all updates.

Total Commander versions:
TC 11.01 x32 and x64

TC run methods:
Non-elevated, Elevated and SYSTEM (using 'RunAsSystem V1.3.6' by Uwe Sieber.)

Tests in all of the above:
Double clicking in TC on all regedit.exe and regedt32.exe files, I could find in the Windows, System32, SysWOW64 folders.
Double clicking in TC on several different .reg-files places in different folders (Windows, System32, SysWOW64, C:/temp etc.)

Test time:
Approx. half an hour.

Result:
In all cases I got NO ERRORS AT ALL.

The end-message for double clicking a .reg-file in TC, was the same in all cases:
'xxxx.reg have been successfully added to the registry.'

Ps: I looked at least twice in the registry afterwards to make sure, that the settings had been added.


Pps: The tests was actually quite appropriate for me, as we were currently talking about the registry in my senior PC club.
HerbieH*
-Keep on makin' music!
User avatar
white
Power Member
Power Member
Posts: 5780
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Issues executing a ".reg" file...

Post by *white »

wanderer wrote: 2023-09-08, 09:21 UTC On a Win2K19 server, double-clicking on a ".reg" file:

- From Explorer: UAC window appears and when i press Yes, it asks to import the registry file and proceeds normally.
- From TC 11.01: I get an "access denied / application not found" message (even though my account is Local Admin on the server, i tried executing TC as plain user and "as admin", no difference)
Does that mean you don't get an UAC window when using 64-bit TC?
Do you get exactly the same error when you choose No in the UAC screen when using 32-bit TC?
User avatar
wanderer
Power Member
Power Member
Posts: 1640
Joined: 2003-03-28, 14:35 UTC
Location: Sol

Re: Issues executing a ".reg" file...

Post by *wanderer »

white wrote: 2023-09-10, 07:36 UTCDoes that mean you don't get an UAC window when using 64-bit TC?
Yes. I always get this error, regardless of whether TC has been executed normally or "As admin".
white wrote: 2023-09-10, 07:36 UTCDo you get exactly the same error when you choose No in the UAC screen when using 32-bit TC?
No. In that case, i get no messages.

Windows version: https://imgur.com/a/URrmVj7
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
User avatar
white
Power Member
Power Member
Posts: 5780
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Issues executing a ".reg" file...

Post by *white »

wanderer wrote: 2023-09-10, 09:11 UTC
white wrote: 2023-09-10, 07:36 UTCDoes that mean you don't get an UAC window when using 64-bit TC?
Yes. I always get this error, regardless of whether TC has been executed normally or "As admin".
I meant, when you start 64-bit TC as normal user (non elevated), do you then get an UAC window?
Post Reply