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
pause

Please advice

Thank you

amlifeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sirbountyCommented:

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!
0
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
0
oBdACommented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Illustration Software

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.