See the top rated post in this thread. Click here

Results 1 to 9 of 9

Thread: How to change Registry key before AutoCAD runs

  1. #1
    Member
    Join Date
    2000-12
    Posts
    9
    Login to Give a bone
    0

    Question How to change Registry key before AutoCAD runs

    I have an application in which I need to change a registry key (which simply
    changes a path that the application looks for a config file) before autocad
    loads. Sure i can double click on a .reg file then run autocad but Im trying
    to make this seamless to the users. So my thinking was to put this regedit
    line in the target box of the Autocad Icon on the desktop prior to the
    command to call and open autocad:
    regedit -s C:\changeregistry.reg "Crogram files\.....autocad.exe" /p
    "Company Profile.arg"

    this doesnt work cause it seems to only make the registry change and not
    open autocad. Any suggestions on changing registry values before autocad
    runs in the application icon?

  2. #2
    All AUGI, all the time Avatart's Avatar
    Join Date
    2004-06
    Location
    Upsidedown in dreamtown
    Posts
    928
    Login to Give a bone
    0

    Default Re: How to change Registry key before AutoCAD runs

    Quote Originally Posted by pporter
    I have an application in which I need to change a registry key (which simply
    changes a path that the application looks for a config file) before autocad
    loads. Sure i can double click on a .reg file then run autocad but Im trying
    to make this seamless to the users. So my thinking was to put this regedit
    line in the target box of the Autocad Icon on the desktop prior to the
    command to call and open autocad:
    regedit -s C:\changeregistry.reg "Crogram files\.....autocad.exe" /p
    "Company Profile.arg"

    this doesnt work cause it seems to only make the registry change and not
    open autocad. Any suggestions on changing registry values before autocad
    runs in the application icon?
    I am no expert on these matters, but I would imagine that the regedit needs some sort of pause to execute prior to the ACAD.exe launch? No idea how you would do that though.

  3. #3
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,420
    Login to Give a bone
    0

    Default Re: How to change Registry key before AutoCAD runs

    Try using a good ole bat file. You can edit a reg key using a text file with a *.reg extension.
    Your bat file might look like:

    MyThirdPartyApp.reg
    acad.exe /t /p
    C:> ED WORKING....


    LinkedIn

  4. #4
    Member
    Join Date
    2000-12
    Posts
    9
    Login to Give a bone
    0

    Default Re: How to change Registry key before AutoCAD runs

    Thanks to everyone for their help. The problem really wasnt getting the registry to fire off and change or starting autocad, the problem was the way autocad would start if I used the command line switch /p To specify a profile. Autocad wouldnt read the %%installfolder%% and other variables in the .arg file for the variable value, it was instead being intered into the support paths and the such as simply %%installfolder%%/support which of course would cause all kind of "not found messages when loading.

    But i was able to make the registry change and fire off the application with the profile command switch by creating a vbscript file. so now i simply run the vbscript in the target field of the Autcad icon.

    Thanks again.

  5. #5
    Member
    Join Date
    2006-09
    Location
    iran
    Posts
    9
    Login to Give a bone
    0

    Lightbulb Re: How to change Registry key before AutoCAD runs

    hi pporter

    FOR YOU
    Attached Images Attached Images
    • File Type: jpg 1.JPG (111.1 KB, 97 views)
    • File Type: jpg 2.JPG (125.2 KB, 89 views)

  6. #6
    I could stop if I wanted to
    Join Date
    2005-08
    Location
    Albania
    Posts
    423
    Login to Give a bone
    0

    Default Re: How to change Registry key before AutoCAD runs

    Quote Originally Posted by milad004
    hi pporter

    FOR YOU
    I think this is for alias-command it's not for the registry.

  7. #7
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,105
    Login to Give a bone
    0

    Default Re: How to change Registry key before AutoCAD runs

    Quote Originally Posted by pporter
    Thanks to everyone for their help. The problem really wasnt getting the registry to fire off and change or starting autocad, the problem was the way autocad would start if I used the command line switch /p To specify a profile. Autocad wouldnt read the %%installfolder%% and other variables in the .arg file for the variable value, it was instead being intered into the support paths and the such as simply %%installfolder%%/support which of course would cause all kind of "not found messages when loading.

    But i was able to make the registry change and fire off the application with the profile command switch by creating a vbscript file. so now i simply run the vbscript in the target field of the Autcad icon.

    Thanks again.
    Would you mind sharing your vbscript file for others with this problem? You may have to place it within a zip file or post the code within [code] tags.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  8. #8
    I could stop if I wanted to
    Join Date
    2005-08
    Location
    Albania
    Posts
    423
    Login to Give a bone
    0

    Default Re: How to change Registry key before AutoCAD runs

    Quote Originally Posted by pporter
    I have an application in which I need to change a registry key (which simply
    changes a path that the application looks for a config file) before autocad
    loads. Sure i can double click on a .reg file then run autocad but Im trying
    to make this seamless to the users. So my thinking was to put this regedit
    line in the target box of the Autocad Icon on the desktop prior to the
    command to call and open autocad:
    regedit -s C:changeregistry.reg "Crogram files.....autocad.exe" /p
    "Company Profile.arg"

    this doesnt work cause it seems to only make the registry change and not
    open autocad. Any suggestions on changing registry values before autocad
    runs in the application icon?
    I don't understand why you want to use registry of AutoCAD because is a little difficulty to manage them.
    Maybe can changes in AutoCAD icon like this Crogram files.AutoCAD\acad.exe" /p

  9. #9
    Member
    Join Date
    2000-12
    Posts
    9
    Login to Give a bone
    1

    Default Re: How to change Registry key before AutoCAD runs

    Quote Originally Posted by Opie
    Would you mind sharing your vbscript file for others with this problem? You may have to place it within a zip file or post the code within [code] tags.
    Here is the vbscript that i used to change the registry. First off I cant use the regedit command because IT has that locked away from average users so this way seems to work better. Here is the code:
    ''-------------------------------------------------------------------------------------------------------------------------------
    Dim WshShell
    Set WshShell = WScript.CreateObject ("WScript.Shell")

    WshShell.RegWrite "HKCU\Software\COADE, Inc.\CADWorx 2007\P&ID\Settings\Configuration 17", "J:\13.05.01 Borders\CADWorx_PID\System\Imperial.cfg", "REG_SZ"
    'WScript.Echo WshShell.RegRead("HKCU\Software\COADE, Inc.\CADWorx 2007\P&ID\Settings\Configuration 17")

    ''Now Start Autocad
    WshShell.run """C:\Program Files\AutoCAD 2007\acad.exe"" /P ""J:\13.05.01 Borders\CADWorx_PID\CADWorx_PID_2007.arg"""
    set WshShell = Nothing
    ''-------------------------------------------------------------------------------------------------------------------------------


    Now in the target field of the Autocad icons Properties dialog box replace the contents with :
    "J:\13.05.01 Borders\CADWorx_PID\Cadworx_J.vbs"

    So when you double-click the Autocad icon it actually runs the VBscript above that sets the registry values first, then kicks off autocad.

Similar Threads

  1. Mac OS x 10.8 (Mountain Lion) How to clean the registry in MAC ? I want to reset my AutoCAD.
    By sandeep_koodal in forum Operating Systems
    Replies: 2
    Last Post: 2013-07-26, 04:38 AM
  2. Setting a registry key in AutoCAD LT via a toolbar button
    By johan d in forum AutoCAD LT - General
    Replies: 1
    Last Post: 2006-05-24, 02:05 PM
  3. Windows XP - Major Issues with AutoCAD Registry in XP
    By kcover in forum Operating Systems
    Replies: 5
    Last Post: 2006-01-25, 02:44 PM
  4. Can I change ACAD startup dir in registry?
    By Borg in forum VBA/COM Interop
    Replies: 2
    Last Post: 2005-01-18, 04:24 PM
  5. Windows XP - AutoCAD in Registry
    By priitl22047477 in forum Operating Systems
    Replies: 3
    Last Post: 2004-10-16, 04:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •