• Home
  • Training Books
  • Subscribe to Our Email Newsletter
  • About
    • Contributors
    • Feedback
    • Contact
    • Privacy policy
    • Cookie Policy

CADnotes

CAD Tutorials and Best Practices for professionals and students

  • Featured
  • AutoCAD
    • AutoLISP
  • Revit
    • Revit Architecture Basic
    • Revit MEP Basic Tutorial
  • Inventor
  • MicroStation
    • MicroStation Basic Tutorial
You are here: Home / AutoCAD / Open AutoCAD drawings as read only using right click from Explorer

Open AutoCAD drawings as read only using right click from Explorer

July 16, 2013 by Huong Charles 15 Comments

In this Article...

  • Creating the script
    • For Windows XP
    • For Windows 7
    • Additional tip for Windows 7

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.

About Huong Charles

Huong Charles is working in the oil & gas industry in the USA as an electrical drafter. Huong uses AutoCAD to create plan drawings (drawings related to the layout of the processing plant), installation detail drawings, and simple 3D models for use in the overall plant model. She also uses specialized software for electrical design that works with AutoCAD.

Filed Under: AutoCAD Tagged With: autocad tips

5 1 vote
Article Rating
Subscribe
Login
Notify of
guest

guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

15 Comments
Inline Feedbacks
View all comments
Chris
Chris
6 years ago

This stopped working on my Windows 10 after my company did a reconfiguration. Any ideas? I have it saved in my SendTo folder but when I right-click on a drawing file, the old Read Only option does not present itself. It has severely affected my work flow!

3
Reply
Jerry Berns
Jerry Berns
7 years ago

This solution works great for single files. I’ve applied the solution to Windows 10 with no need for modification to the code.
However, what modifications would be required to select multiple files and then open all as Read-Only?

Regards,
Jerry

0
Reply
hcharles
hcharles
Reply to  Jerry Berns
6 years ago

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
For Each item in cmd_arg
acadApp.Documents.Open item, True
Next

0
Reply
ante s.
ante s.
9 years ago

I can`t open my read-only file
Script answer:
C:\User\username\AppData\Roaming\Microsoft\Windous\OpenReadOnly.vbs
Line: 1
chair: 3
Error: Invalid character
code: 800A0408
Source: Microsoft VBSscript compilation error
How correct error character, compilation ? ante, thanks

0
Reply
Jon
Jon
Reply to  ante s.
9 years ago

I had the same problem. Then I removed the double quotes from the script file, and it worked just fine!

0
Reply
Dan T
Dan T
Reply to  ante s.
7 years ago

You spelled Windows wrong in your path

0
Reply
Selinda
Selinda
11 years ago

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?

0
Reply
Nicholas
Nicholas
Reply to  Selinda
9 years ago

Did you ever figure out how to make this work?

0
Reply
melinda
melinda
11 years ago

Hi,

Can you please explain how to load this on Windows 8?

Thanks so much!

0
Reply
Igor
Igor
11 years ago

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

0
Reply
Edwin Prakoso
Edwin Prakoso
Editor
Reply to  Igor
11 years ago

If you double click a DWG file, which one will open it? Is it AutoCAD? If yes, you can change the default program to open DWG file. You need to define it by modifying registry. Try this DWG Launcher fix on Design and Motion.

0
Reply
Steve
Steve
Reply to  Edwin Prakoso
10 years ago

Edwin thanks for your help…

I’m having a similar problem to Igor, only I only have LT installed. Is there some way I can modify the code so that it launches in LT?

Steve

0
Reply
Paul munford
Paul munford
11 years ago

Holding Down the shift key and right clicking in Windows also gives you a read only option…

0
Reply
Edwin Prakoso
Edwin Prakoso
Editor
Reply to  Paul munford
11 years ago

DWG doesn't seem to have that option in contextual menu, Paul. However, I do have that option for Word and Excel files. That could be from Office installation.
So if you have it on contextual menu, it must be from a software you installed on your computer.

0
Reply
Paul Munford
Paul Munford
Reply to  Edwin Prakoso
11 years ago

Hey – you're right! Good catch Edwin :)

0
Reply
wpdiscuz   wpDiscuz

Featured

What’s New in Revit 2021 – part 1: General Enhancements

Revit 2021 has been released! See what’s new in part 1. More to come!

Recent Articles

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available

Advertisement

New on CADnotes

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available
  • Autodesk Forma Design Contest
  • Revit 2025: Toposolid Enhancements

Meet the Authors

avatar for
avatar for
avatar for
avatar for
avatar for
avatar for

Get Connected

CADnotes on FacebookCADnotes on InstagramCADnotes on TwitterCADnotes on YouTube

© 2009 – 2025 CADnotes · Feedback · Privacy Policy · Become an affiliate

wpDiscuz