Link to home
Get AccessLog in
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
Avatar of Pr1z
Pr1z
Flag of United Kingdom of Great Britain and Northern Ireland image

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
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/
Avatar of sreeranga_vs
sreeranga_vs

ASKER

hello Pr1z,
"\" at the beginning of the line was a typo....
slash at the end is required....
Hello epichero22,

Thanks for the Info... I do make use of  reg cleaner but I wanted the script.
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
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

ASKER CERTIFIED SOLUTION
Avatar of Jared Luker
Jared Luker
Flag of United States of America image

Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
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.
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
Hello jared_luker

I am logged in as an administrator on my virtual machine.
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.
From:  https://www.experts-exchange.com/questions/26743874/Folder-Redirection-Icons-rearrange-with-auto-arrange-disabled.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.
Oops... sorry... posted that last one in the wrong question
Avatar of Dirk Haest
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.