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

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

Post by *wanderer »

white wrote: 2023-09-10, 09:56 UTCI meant, when you start 64-bit TC as normal user (non elevated), do you then get an UAC window?
Nope. Directly the error.
- 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: 5783
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

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

Post by *white »

wanderer wrote: 2023-09-09, 11:26 UTC EDIT: Manually executing both regedit.exe's works fine.
How about executing your .reg file with full path on the Command Prompt of c:\windows\system32\cmd.exe and on the Command Prompt of c:\windows\SysWOW64\cmd.exe? Does that both work?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

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

Post by *ghisler(Author) »

You can create an internal association for *.reg pointing to the correct location of regedit.exe.
Author of Total Commander
https://www.ghisler.com
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, 13:54 UTCHow about executing your .reg file with full path on the Command Prompt of c:\windows\system32\cmd.exe and on the Command Prompt of c:\windows\SysWOW64\cmd.exe? Does that both work?
I created a batch file with these contents:

Code: Select all

@echo off
regedit "D:\Test.reg"
From within TC, I went to C:\Windows\System32 and executed cmd.exe. From there, i executed the batch file.

I repeated the same process but from C:\Windows\SysWOW64.

From both locations, the regedit was executed properly.
ghisler(Author) wrote: 2023-09-11, 09:57 UTC You can create an internal association for *.reg pointing to the correct location of regedit.exe.
Thanks for the workaround. The only reason i've gone this far with this matter is to clarify if there is some Windows peculiarity which affects TC. I still can't understand why this is happening and in reverse (x32 is working while x64 is not!). The server is a setup performed by a client of mine which resides in their domain, so i can't say for sure that there is no strange policy that may affect this issue. It looks like a normal Windows Server setup, but you never know.

Anyway, i'll keep this in mind and if i ever find what's causing it, i'll post the news here.

P.S.: On a hunch, from within TCx64, i rightcliked on the .reg file and selected the first item from the context menu (execute the default app). I got the windows prompt, asking me if i wish to keep using regedit application. I pressed OK and regedit was executed normally (with UAC and everything).

@Christian
is there perhaps anything i could do that might help you understand what's going on?
- 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: 5783
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

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

Post by *white »

wanderer wrote: 2023-09-12, 07:30 UTC From within TC, I went to C:\Windows\System32 and executed cmd.exe. From there, i executed the batch file.
I repeated the same process but from C:\Windows\SysWOW64.
Why didn't you simply execute "D:\Test.reg" at the command prompt like I suggested, to test running it via file association. Or doesn't that work on that Windows version?
wanderer wrote: 2023-09-12, 07:30 UTC From both locations, the regedit was executed properly.
Which version of regedit was executed in each case? 32-bit or 64-bit?
wanderer wrote: 2023-09-12, 07:30 UTC The only reason i've gone this far with this matter is to clarify if there is some Windows peculiarity which affects TC. I still can't understand why this is happening and in reverse (x32 is working while x64 is not!).
I am curious too. Apparently access is denied when trying to execute one of the regedit.exe files. Perhaps you can use Sysinternals Process Monitor to find out which one?

BTW, did you try to drag the .reg file to the button bar to create a new button and then click the button?
And just for ruling out, did you try with Total Commander with a clean ini file?
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-12, 09:08 UTCWhy didn't you simply execute "D:\Test.reg" at the command prompt like I suggested, to test running it via file association. Or doesn't that work on that Windows version?
I simply didn't get it! :) I repeated the process now, as you suggested. I created a folder in D: and gave permissions to everyone. Then i opened both CMDs and executed the reg file from each one. They both worked fine. I then went with TCx64 in that folder and doubleclicked the reg file. Access denied.
wanderer wrote: 2023-09-12, 07:30 UTCWhich version of regedit was executed in each case? 32-bit or 64-bit?
I can't know that because regedit's UI does not open. I assume in each case, the corresponding one was executed.
wanderer wrote: 2023-09-12, 07:30 UTCI am curious too. Apparently access is denied when trying to execute one of the regedit.exe files. Perhaps you can use Sysinternals Process Monitor to find out which one?
I suspect the case is similar to what i've seen in several other cases in the past. The errors that produce such messages are sometimes irrelevant to the message. In this case "Access denied" may mean that an unexpected error occurred and the closest message that the code lead to, was that.
wanderer wrote: 2023-09-12, 07:30 UTCBTW, did you try to drag the .reg file to the button bar to create a new button and then click the button?
And just for ruling out, did you try with Total Commander with a clean ini file?
Hmmm. A blank ini is always a good idea. So, i tried both your suggestions. In both cases, i got the same error. I'm guessing something prevents the proper execution of regedit and doesn't have to do with permissions of the reg file. The "application not found" points to that.

@Christian. When double-clicking on a file, what does TC do?
- 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: 5783
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

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

Post by *white »

wanderer wrote: 2023-09-13, 07:15 UTC Then i opened both CMDs and executed the reg file from each one. They both worked fine. I then went with TCx64 in that folder and doubleclicked the reg file. Access denied.
wanderer wrote: 2023-09-12, 07:30 UTCWhich version of regedit was executed in each case? 32-bit or 64-bit?
I can't know that because regedit's UI does not open. I assume in each case, the corresponding one was executed.
You don't get a warning "Are you sure to continue" after executing a .reg file? If that warning is on the screen, you can check the task manager to see which version of regedit.exe is running. On my system it says "Register-editor (32-bit)" if 32-bit is running, and "Register-editor" if 64-bit is running. (Also, on the Details tab, you can check the Architecture column)
wanderer wrote: 2023-09-13, 07:15 UTC
wanderer wrote: 2023-09-12, 07:30 UTCI am curious too. Apparently access is denied when trying to execute one of the regedit.exe files. Perhaps you can use Sysinternals Process Monitor to find out which one?
I suspect the case is similar to what i've seen in several other cases in the past. The errors that produce such messages are sometimes irrelevant to the message. In this case "Access denied" may mean that an unexpected error occurred and the closest message that the code lead to, was that.
Perhaps. It's pretty clear though that regedit.exe isn't started because the UAC message doesn't appear. So some version of regedit.exe or other program cannot be started. The error seems to come from an api called by Total Commander. So my idea was to check with Process Monitor, filter on the Total Commander process and see if you can find out which program in which folder TC is trying to open.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

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

Post by *ghisler(Author) »

@Christian. When double-clicking on a file, what does TC do?
TC calls ShellExecuteEx with the file, the rest is handled by Windows.
Author of Total Commander
https://www.ghisler.com
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-13, 08:07 UTCYou don't get a warning "Are you sure to continue" after executing a .reg file?
Nope. In TCx64, i just get the error window. No UAC, no warning, no... nothing.

Trying this with 32-bit TC, in task manager indeed i see "Registry Editor (32 bit)".
- 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
AntonyD
Power Member
Power Member
Posts: 1563
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

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

Post by *AntonyD »

2wanderer
can you please share with us the content of this reg file?
#146217 personal license
User avatar
white
Power Member
Power Member
Posts: 5783
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

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

Post by *white »

wanderer wrote: 2023-09-13, 10:13 UTC
white wrote: 2023-09-13, 08:07 UTCYou don't get a warning "Are you sure to continue" after executing a .reg file?
Nope. In TCx64, i just get the error window. No UAC, no warning, no... nothing.
I know, I was talking about when you did the tests with 32-bit and 64-bit cmd.exe.
AntonyD wrote: 2023-09-13, 10:44 UTC can you please share with us the content of this reg file?
How is that relevant? regedit.exe is not started and the same thing happens with a blank .reg file.
User avatar
AntonyD
Power Member
Power Member
Posts: 1563
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

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

Post by *AntonyD »

2white
How is that relevant?
you would not believe :)) but sometimes very simple typos lead to some strange errors in these 2 different regedit programs)))
therefore, in fact, the launch of the program was - but very short-lived, because the correctness of the input information was simply checked and, based on its negative assessment, an exit was made.
#146217 personal license
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 »

2AntonyD
The same file is normally imported with the 32-bit regedit.exe. I also tried other reg files, so...

EDIT: Also, this file is a registry export, not manually edited.

2white
With ProcMon, i saw that after ShellExecuteEx was called, Windows called "CreateFile" in an effort to open "C:\Windows\System32\regedit.exe", and not "C:\Windows\regedit.exe" (if you remember, a few posts back, that's the location in registry for the x64 regedit.exe).

Seeing that, i copied "C:\Windows\regedit.exe" into "C:\Windows\System32" and expected it to work. Unfortunately it didn't, but the behavior changed. I now get a UAC question, but when i answer Yes, it does nothing (no warning or data importing to registry).

From the above behavior, it seems to be a Windows/ShellExecute issue...
- Wanderer -

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Normally using latest TC on:
x32: WinXPx32 SP3 (very rarely nowadays).
x64: Clients/Servers - Win10/Win11 and Win2K16 to Win2K22, mainly Win10 though.
Post Reply