| 1. |
Solve : Batch file auto answer? |
|
Answer» I am trying to make a batch file using the "reg" command which edits entries in the registry. Specifically, I want to automatically delete a SPECIFIC registry entry every time a program boots up. The only problem is that the "reg" command requires you to confirm the deletion of the entry (considering it's a registry entry it's understandable). I also checked the "help" part of the "reg" command, there doesn't seem to be any flag to force the deletion. Ummm ..., why does this particular registry key keep getting added back to the registry? Please, do not take this as being rude, but does that matter? I know that I want to delete this registry value and I know what it does. My only question is not about the registry value and how or why it is added, but whether or not the "reg" command can have an autoanswer in the PARAMETER field to get through the confirmation. I would think that it would be a lot easier too just leave the confirmation box activated then cahnging it because there are many risks involvedNot for nothing, yes it is true that playing around with the registry can be dangerous, but that is why you can easily export any key with the simple click of the mouse button. Also, I don't think there should be this divine mystry about the sensitivity of registry values, some registry values simply disable the screensaver, some autoexecute a file on startup, some remove the trash can from your desktop, and so? That's what they do, people who know what they're doing, well, know what they're doing. If you don't know what you're doing and don't back up a registry key, then, well, that's your fault, and you sort of ask for what happens to your computer. But the fact of the matter, some people do know what they need to do, and I think it is presumptuous for the coders of command lines to think otherwise. Just putting a simple /y option isn't turing off the failsafe for those who may not be sure of whether to delete something or not, but to NOT give the option for experienced users on the assumption that "it is dangerous" is just silly imo. just do an echo Code: [Select]C:\test>echo Y | reg DELETE HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\ /v test Delete the registry value test (Y/N)? The operation completed successfully Quote from: ghostdog74 on September 09, 2007, 09:27:15 PM just do an echo Thank you very much ghostdog74 that was the simple answer I was looking for and it worked as well. Also I found this PAGE: http://www.windowsitpro.com/Article/ArticleID/14741/14741.html which says: Quote Would delete the HKEY_LOCAL_MACHINE\Software\test value. When you enter the command you will be prompted if you really want to delete, enter Y. To avoid the confirmation add /force to the command, e.g. However, I tried using that syntax using "/force" and it didn't work. In any event, the echo worked, thanks ghostdog. |
|