/build/static/layout/Breadcrumb_cap_w.png

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:
Posted by: jagadeish 10 years ago
Red Belt
1

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
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ