Jump to content

removeing autorun files via a .reg file


twizt3d

Recommended Posts

How do I stop something from loading with windows, I know the reg key is

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]

and to remove it you do [-HKEY_LOCAL............] but what if I want to just remove one line from under it, like only stop one program, i dont want to delete the whole key....

Link to comment
Share on other sites


I figured this out, heres the information for anyone else interesed.

People have wondered how to remove keys and values from the registry simply by importing a registry file. 



All that needs to be done to achieve this is the insert a hyphen, -, in front of the "H" in HKEY.......

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft]

would delete the entire Microsoft key from this location.



In order to just delete a value the syntax is to set the value equal to Hyphen, -.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft]
"VALUE"=-

Would delete "VALUE" from this area of the registry.

Link to comment
Share on other sites

  • 3 weeks later...

twizt3d

You got the right idea, especially usefull for Unattended

Can also use

REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v CloneCDTray
 Deletes the registry value CloneCDTray under Run

Autoruns is ok but sometimes you just need to apply it another way.

Link to comment
Share on other sites

  • 2 months later...
Does this method works already if called from cmdlines.txt?

No because anysoftware you have that installs autorun entries would do so AFTER cmdline.txt stage so it would be better to call regedit silently at the end of your batch or runonceex.cmd (after all your programs have been installed).

here's an example of what you might put in your regtweaks.reg:

Windows Registry Editor Version 5.00
;=============================
; Remove Autorun Entries:
;=============================

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"ATI Launchpad"=-
"Eraser"=-

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"SunJavaUpdateSched"=-

Also some programs will just put a link to themselves in one of the startup folders

so you might need additional lines at the end of your batch/runonceex.cmd (or preferably in a separate cleanup.cmd)

:This code is for a batch file or command script NOT a .reg file

: Remove entries from startup folders
DEL "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\Startup\SHORTCUTNAME.lnk"
DEL "%systemdrive%\Documents and Settings\%username%\Start Menu\Programs\Startup\SHORTCUTNAME.lnk"

where you would replace "SHORTCUTNAME" with the name of the shortcut to be deleted (or just use "*" if you want to empty it) :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...