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

Posted on 2008-11-05
Last Modified: 2013-12-02
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

Question by:amlife
    LVL 67

    Expert Comment


    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!

    Author Comment

    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
    LVL 82

    Accepted Solution

    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

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
    In this article, I’ll explain how I make a clipping mask out of several separate vector objects by using the Compound Path option in Adobe Illustrator. A compound path in Illustrator allows grouping of separate objects into one set of vector paths t…
    In this tutorial viewers will learn how to apply a non-rasterized, vector-scalable texture to a vector using opacity texture masks in Illustrator Open a vector in Illustrator. Black and white vectors work best, but this effect can also be used to ad…
    In this tutorial viewers will learn tricks for more effective scaling of vectors in Illustrator Open a document with vectors to be scaled in Illustrator: Normally, items do not keep their proportions when scaled. To fix this, hold down the shift key…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now