Open AutoCAD drawings as read only using right click from Explorer

There are many ways to open AutoCAD drawings. You can use open from AutoCAD menu/command. You can double click a DWG file. Or you can drag and drop the drawing to AutoCAD shortcut/Window.

This time Huong Charles shares how you can open AutoCAD drawing file in read only state. Just using contextual menu in Windows Explorer!

right click

© Prashant ZI – Fotolia.com

Creating the script

To make this possible, you need to create a script file. You need to run notepad (or other plain text editor). Copy the code below and save the file as “OpenReadOnly.vbs”. Use the double quotes to preserve the extension. Otherwise, Windows will save the file as OpenReadOnly.vbs.txt.

For Windows XP

Create a file containing the following code:

On Error Resume Next
dim cmd_arg
set cmd_arg=wscript.Arguments
Dim acadApp
Set acadApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set acadApp = CreateObject("AutoCAD.Application")
End if
acadApp.visible=True
acadApp.WindowState = normal
acadApp.Documents.Open cmd_arg(0), True

Save this as OpenReadOnly.vbs anywhere, say your “My Documents” folder.

In Windows Explorer (also can do this in the “My Documents” window), go into Tools, Folder Options, File Types, scroll down to DWG.

Click Advanced.

Click New.

Under Action, put “Open Read-Only”

Under “Application…”, put wscript.exe “C:\Documents and Settings\hcharles\My Documents\OpenReadOnly.vbs” “%1”  (with the quotes)

Click OK twice, then Close.

Now when you right click on a DWG file, choose Open Read-only.

Tested on local files in AutoCAD 2008 XP SP3 Platform.

For Windows 7

Using Notepad, create a file containing the following (same as was for Windows XP)

On Error Resume Next
dim cmd_arg
set cmd_arg=wscript.Arguments
Dim acadApp
Set acadApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set acadApp = CreateObject("AutoCAD.Application")
End if
acadApp.visible=True
acadApp.WindowState = normal
acadApp.Documents.Open cmd_arg(0), True

Save this as OpenReadOnly.vbs in your “send to” folder (C:\Users\yourusername\AppData\Roaming\Microsoft\Windows\SendTo ).

To use, right click on the drawing in the directory, select “Send To” then “OpenReadOnly.vbs”

Additional tip for Windows 7

You can also save the file anywhere. Then select the file, right click> copy.

Go to SendTo folder then right click> paste shortcut.

If you choose to put shortcut in that folder, you can rename the shortcut and change the icon as necessary.

shortcut_properties

This is the final result looks like on Windows 7:

open_read_only

Thank you to Huong Charles for the nice tip!

If you want to be a guest author, please read our quality guidelines here.

Comments

    Leave a Reply

    Your email address will not be published. Required fields are marked *

  1. Selinda says

    Thanks for the info Huong. I followed the steps for the Windows 7 and the option is there to open in read only when I right click on the file. However, nothing happens when I select it. I copy and pasted the code so there shouldn’t be anything wrong with it. I’m running AutoCAD 2012 LT. I’m also on a network. The dwg files I use are on our P: drive but my AutoCAD is saved to my C: drive. Any thoughts?

  2. Igor says

    This solution is great and it is working but I have another problem.
    I have two versions of ACAD installed. One full version and another ACAD LT.
    How can I modify this script so that when I call it, it opens drawings only in ACAD LT.
    Now it automatically opens all dwg. in full ACAD version and it is not suitable for me.
    Thank you and best regards,

    Igor