• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2625
  • Last Modified:

Need help in creating a batch file that will add and remove some registy keys.

Hello everyone

This is my first post, I wish i will have some luck with this

we have installed Adobe Acrobat Pro 9 on 3 Pcs in the office today

we are getting this Error when we try to launch the software

"Microsoft Visual C++ Debug Library
Runtime Error!
Program: C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe
The application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. "

after troubleshooting for hours we found a solution which involves editing 2 registry keys .. it must be done before lunching the application or it will not work

so want I want to do,  is to create a batch file that can be added to the login script so it can be done automatically without user awareness

the registry keys that need to be chnaged

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

a string value "AppData"   chnage the current value to C:\Adobe

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

a string value "AppData"  chnage the current value to C:\Adobe

I created a batch file but I did not have luck runing it (every time i try to run it I get this error "Invalid command-line parameters" )

my batch file

REG DELETE HKCU\Software\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders /v AppData

REG ADD HKCU\Software\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders /v AppData /t REG_SZ /d C:\Adobe

REG DELETE HKCU\Software\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders /v AppData

REG ADD HKCU\Software\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders /v AppData /t REG_SZ /d C:\Adobe

Please advice

Thank you

1 Solution

Couple of things...
You don't need to delete the value - just overwrite it...

Secondly, your key shows Software twice.
You also son't have to specify the type, if it's string - that's the default...
Lastly, enclose C:\Adobe in quotes.

Try this:
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders /v AppData /d "C:\Adobe"
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders /v AppData /d "C:\Adobe"

Oh and - welcome to Experts Exchange!
amlifeAuthor Commented:
thanks verymuch for your help and support, still getting the same message

Too many command-line parameters

I start thinking there cound be someting wrong with my computer
The main problem is actually the registry path, because it contains a space in "Shell Folders", so it needs to be enclosed in quotes; "C:\Adobe" would work without quotes, but it's a very good habit to *always* use quotes around arguments that could contain a space (think environment variables).
Thenh you'll need a /f to force overwriting of the existing value, otherwise the user will be prompted.
Finally, you should only need to do this in "User Shell Folders", "Shell Folders" is actually somewhat of a copy of "User Shell Folders", but with expanded environment variables.
So it should come down to

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "AppData" /d "C:\Adobe" /f

But note that this will change the default location of your Application Data folder; this should point to one general root folder, not to an application-specific folder, because AppData will be used by different programs.
This registry change might help with the Acrobat symptoms, but I seriously doubt that it's actually a cure for the underlying problem, and it's likely to cause problems with other applications.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now