Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Errors on Reg Delete

79 views
Skip to first unread message

Docfxit

unread,
Aug 19, 2017, 2:57:38 PM8/19/17
to
I have used this code recently and it worked fine. Now when I use it on the same Win7 PC I get errors.

@echo off
Reg Delete "HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v "PastIconsStream"=- /f
Reg Delete "HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v "IconStreams"=- /f
taskkill /f /IM explorer.exe
Start explorer.exe
cmd

These are the errors I get:
ERROR: The system was unable to find the specified registry key or value.
ERROR: The system was unable to find the specified registry key or value.
ERROR: The executable program that this service is configured to run in does not
implement the service.

I know the registry keys are there. I can delete them manually.
I don't know why this computer is throwing errors for this.

Thanks,
Docfxit

JJ

unread,
Aug 21, 2017, 10:07:08 AM8/21/17
to
Try running the script elevated.

Docfxit

unread,
Aug 21, 2017, 6:25:10 PM8/21/17
to
Thanks for the suggestions.

It didn't work.

Docfxit

B00ze

unread,
Aug 21, 2017, 11:34:56 PM8/21/17
to
On 2017-08-19 14:57, Docfxit <doc...@theoffice.la> wrote:

> I have used this code recently and it worked fine. Now when I use it on the same Win7 PC I get errors.
>
> @echo off
> Reg Delete "HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v "PastIconsStream"=- /f
> Reg Delete "HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v "IconStreams"=- /f
> taskkill /f /IM explorer.exe
> Start explorer.exe
> cmd
>
> These are the errors I get:
> ERROR: The system was unable to find the specified registry key or value.
> ERROR: The system was unable to find the specified registry key or value.

PastIconsStream"=- is fine for .reg files, but you are using Reg Delete, just specify the value name, do not pad with =-

Regards,

--
! _\|/_ Sylvain / B00...@hotmail.com
! (o o) Member:David-Suzuki-Fdn/EFF/Red+Cross/SPCA/Planetary-Society
oO-( )-Oo I survived torture, I'm ready to date Lwaxana. -Picard

B00ze

unread,
Aug 22, 2017, 1:08:11 AM8/22/17
to
On 2017-08-21 23:34, B00ze <B00...@hotmail.com> wrote:

> On 2017-08-19 14:57, Docfxit <doc...@theoffice.la> wrote:
>
>> I have used this code recently and it worked fine. Now when I use it on the same Win7 PC I get errors.
>>
>> @echo off
>> Reg Delete "HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v "PastIconsStream"=- /f
>> Reg Delete "HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v "IconStreams"=- /f
>> taskkill /f /IM explorer.exe
>> Start explorer.exe
>> cmd
>>
>> These are the errors I get:
>> ERROR: The system was unable to find the specified registry key or value.
>> ERROR: The system was unable to find the specified registry key or value.
>
> PastIconsStream"=- is fine for .reg files, but you are using Reg Delete, just specify the value name, do not pad with =-
>
> Regards,

Ah! Backup your keys first! I had created an extra TEST value in
TrayNotify, then deleted it with /v "TEST" and pressed F5 in RegEdit and
it had worked as expected, later I logged off and logged back in and ALL
the values in TrayNotify had disappeared! Freaking Windows; no idea what
happened but I suggest you backup stuff. Also, I think you have to kill
Explorer FIRST, THEN delete the keys and restart Explorer...

Best Regards,

--
! _\|/_ Sylvain / B00...@hotmail.com
! (o o) Member:David-Suzuki-Fdn/EFF/Red+Cross/SPCA/Planetary-Society
oO-( )-Oo Drunken Borg: "Rsilience in floor tile. Wan'be similated?"

Tom Del Rosso

unread,
Aug 26, 2017, 6:22:25 PM8/26/17
to
B00ze wrote:
>
> PastIconsStream"=- is fine for .reg files, but you are using Reg
> Delete, just specify the value name, do not pad with =-

That's probably the reason, but maybe it could also be that the value is
in HKLM rather than a user value.



petu...@googlemail.com

unread,
Aug 29, 2017, 9:38:18 AM8/29/17
to
::----- START -----
@ECHO OFF
SET "CUTN=HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows"
SET "CUTN=%CUTN%\CurrentVersion\TrayNotify"
SET "VALS=PastIconsStream IconStreams"
SET "REXE=explorer.exe"

FOR %%A IN (%VALS%) DO REG DELETE "%CUTN%" /V %%A /F>NUL

:LOOP
TASKLIST /FI "IMAGENAME EQ %REXE%" /FI "STATUS NE RUNNING"^
|FIND /I "%REXE%">NUL &&(START %REXE%)||(TASKKILL /F /IM %REXE% &GOTO LOOP)

::------ END ------
0 new messages