Avatar of sreeranga_vs
sreeranga_vs
 asked on

Trying to cleanup registry entries after an unistall

I had visio installed and afer an unistall it leaves few registry entries behind. I wanted to clean the same up using a script. I had used vb script and windows scripts a long time back and have forgotten.

I am using the below script. When I do so i am getting an error "Invalid root in registry key " at Line 6 char 1 . Error code is 800700003; Source is WshShell.RegDelete.

Can anyone please help...

Dim WshShell , cal1
 
Set WshShell = WScript.CreateObject("WScript.Shell")
cal1 = "\HKLM\SOFTWARE\classes\.vst\"
WScript.echo "xxxxxxxx: " & Cal1
WshShell.RegDelete cal1
VB ScriptMicrosoft Legacy OSProgramming

Avatar of undefined
Last Comment
Dirk Haest

8/22/2022 - Mon
Pr1z

I would guess that the error is the "\" at the begining of the line:
cal1 = "\HKLM\SOFTWARE\classes\.vst\"

Open in new window

 I think it should be:
cal1 = "HKLM\SOFTWARE\classes\.vst\"

Open in new window

 Is the slash at the end also required??

Hope that helps

Priz
epichero22

I would personally use a reg cleaner like CCleaner to correct the registry after an uninstall.  It's very good at finding lingering entries after an uninstall, and will prompt you to make a backup before any changes.  You can download it from here:

http://www.filehippo.com/download_ccleaner/download/59834dc473299e9dcc82cfca1f499481/
sreeranga_vs

ASKER
hello Pr1z,
"\" at the beginning of the line was a typo....
slash at the end is required....
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
sreeranga_vs

ASKER
Hello epichero22,

Thanks for the Info... I do make use of  reg cleaner but I wanted the script.
Pr1z

Can you copy and paste all of the source code, the error says line 6 but there are only 5 lines in your code snippet.  Please use the "code" button on the toolbar to make it easier for everyone to read.

Thanks

Priz
sreeranga_vs

ASKER
Theres a blank line between DIM and Set ..


Dim WshShell , cal1
 
Set WshShell = WScript.CreateObject("WScript.Shell")
cal1 = "\HKLM\SOFTWARE\classes\.vst\"
WScript.echo "xxxxxxxx: " & Cal1
WshShell.RegDelete cal1 

Open in new window

Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
Jared Luker

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
sreeranga_vs

ASKER
HI jared_luker
i tried it and it does not work. I get a message  line 6 char 1 Unable to remove registry key. code 80070002.
Jared Luker

You need to run the script as an admin.  Either right click and say "run as administrator" or open up an admin command prompt and run it with cscript
sreeranga_vs

ASKER
Hello jared_luker

I am logged in as an administrator on my virtual machine.
Your help has saved me hundreds of hours of internet surfing.
fblack61
Jared Luker

Just being logged in as an admin is not enough on Win Vista and above.  You need to specifically run the process as an administrator.  I ran the same script I provided above and it did not work until I ran it as an admin.
Jared Luker

From:  https://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_26743874.html

[Icons moving around], never found a method to prevent it, but an easy fix.....

Save/Restore Desktop icons POSITION with two small Scripts
http://www.autohotkey.com/forum/topic28677.html

Dips S to save it....
Dips R to restore....

Saves the config of the icons to HKCU\Software\Richter, which can also be transfered to another user profile/machine. I keep a shortcut to Restore and to Save, so if I have RDPd into this machine and got the icons out of whack across both monitors, I can easily restore them.....

That Echo's my experience as well.  I was never able to find a way to prevent it, but that is an easy solution so that the users can be enabled to help themselves.
Jared Luker

Oops... sorry... posted that last one in the wrong question
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Dirk Haest

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.