The command runs on command line but not in a batch (cmd) file
Hello Everyone
I am trying to delete an application entry from Program and Features in Windows 7 64-bit and the command works while I run it on command line but when I create a .cmd file, it gives the following error:
'■R' is not recognized as an internal or external command
I have never seen this before.
The command I am using is REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{GUID} /v DisplayName /f
Thanks in advance.
4 Comments
[ + ] Show comments
-
is this on the k1000? - SMal.tmcc 10 years ago
-
Does it matter? I am testing it on a VM. - tellmehow 10 years ago
-
yes it does, the method of delivery could be the problem vs the script file itself - SMal.tmcc 10 years ago
-
The exact command that I have pasted in my question works on the command line and when I copy and paste the exact same command in the notepad and save it as .cmd file, it doesn't. I don't know where the disconnect is and I don't understand how the platform matters. I am also doing it locally for now, not on the network, so the delivery isn't an issue. - tellmehow 10 years ago
-
I think that the curly brackets might have a special significance in batch files but I'm not certain. - chucksteel 10 years ago
-
Do people normally delete software items out of the registry rather than uninstalling them? - AFCUjstrick 10 years ago
Answers (1)
Answer Summary:
Please log in to answer
Posted by:
jagadeish
10 years ago
Ensure that, "Encoding Type" is "ANSI" when you save the text file as .cmd
Comments:
-
Thank you so much. It worked!
Can you please explain why this was required?
Because usually when we save a text file as .cmd, we don't do it. I like to know the reason why I am doing what I am doing. Details will be greatly appreciated. - tellmehow 10 years ago