PDA

View Full Version : Open Drawing read-only from Explorer



rkmcswain
2006-03-30, 12:42 PM
For those of you who like to open drawings directly from Windows Explorer, here is a method of opening those drawings in a "read-only" state.


Create a file containing only the following three lines
attrib +r %1
%1
attrib -r %1
Save it as "c:\acadro.bat"
In Windows Explorer, go into Tools, Folder Options, File Types, scroll down to DWG.
Click Advanced.
Click New.
Under Action, put "Open Read-Only"
Under "Application...", put "C:\acadro.bat" "%1" (with the quotes)
Click OK twice, then Close.
Now when you right click on a DWG file, choose Open Read-only.


Tested with WinXP, Win2K, AutoCAD 2006, and Civil3D 2006

Buffeldrek
2006-08-09, 04:55 PM
Oooooh - good one

10 point from the belgian jury

Buffeldrek
2006-08-13, 05:21 PM
1) I wonder to which thread Buffeldrek's comment applied?
I applied to the content of the post of the opening thread - of the batch file. It is a good tip

robert.1.hall72202
2006-08-14, 01:05 PM
Great tip.....this should come in handy.

chicboi_214
2009-05-28, 08:41 AM
This is a great tip!tried it already,very useful....tnx for the tip!

danalcantara_jov
2009-10-29, 07:36 AM
Just got your post and it is very good one. It is my problem when opening so many files and I dont want to lost my current folder location in opening files directly from CAD but need to open as read-only other files from differet location. Your tip was very helpful, thank you very, very much!!

m_el_mansy2003
2009-11-27, 07:52 PM
i trayed it but the drawing open with auto cad 2009 not from Explorer

sorry for bad english

jaberwok
2009-11-28, 05:10 PM
i trayed it but the drawing open with auto cad 2009 not from Explorer.

opening a dwg file FROM explorer will always open it WITH autocad.

d_m_hopper
2009-12-28, 09:33 PM
This is a handy little tip

RobertB
2010-03-03, 07:25 PM
For those of you who like to open drawings directly from Windows Explorer, here is a method of opening those drawings in a "read-only" state.


Create a file containing only the following three lines
attrib +r %1
%1
attrib -r %1
...

Tested with WinXP, Win2K, AutoCAD 2006, and Civil3D 2006R.K. I think this is a great tip too. However, I've seen the need to delay the resetting of the attribute.

Advise the following:

@echo off
attrib +r %1
%1
ping -n 5 127.0.0.1>nul
attrib -r %1

rkmcswain
2010-03-03, 09:54 PM
R.K. I think this is a great tip too. However, I've seen the need to delay the resetting of the attribute.

Good tip. Mine worked without it, but I can certainly see why it might be needed.

Coolmo
2010-03-04, 02:40 AM
How would you do this in Windows 7? Apparently, windows explorer in Win7 doesn't give you any "apparent" options to do anything with anything. Maybe I just need a Windows 7 for dummys book or something.

RobertB
2010-03-05, 01:13 AM
How would you do this in Windows 7? Apparently, windows explorer in Win7 doesn't give you any "apparent" options to do anything with anything. Maybe I just need a Windows 7 for dummys book or something.No, I think the friendly interface has disappeared. However, you can add it by the registry.

The below sample is for AutoCAD 2010. Change the "18" to "17" for AutoCAD 2007-2009. Change the text in green to match your file location and name.


Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\AutoCAD.Drawing.18\shell\Open_as_Read_Only]
@="Open as Read Only"

[HKEY_CLASSES_ROOT\AutoCAD.Drawing.18\shell\Open_as_Read_Only\command]
@="\"C:\\Acad\\Cache\\Open DWG as Read Only.cmd\" \"%1\""

BeKirra
2010-04-23, 04:41 AM
No, I think the friendly interface has disappeared. However, you can add it by the registry.

The below sample is for AutoCAD 2010. Change the "18" to "17" for AutoCAD 2007-2009. Change the text in green to match your file location and name.


Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\AutoCAD.Drawing.18\shell\Open_as_Read_Only]
@="Open as Read Only"

[HKEY_CLASSES_ROOT\AutoCAD.Drawing.18\shell\Open_as_Read_Only\command]
@="\"C:\\Acad\\Cache\\Open DWG as Read Only.cmd\" \"%1\""
So this will work with v2011 by replacing 18 with 19?
And will it work in Win7 platform?

RobertB
2010-04-23, 04:55 AM
So this will work with v2011 by replacing 18 with 19?
And will it work in Win7 platform?No, there is no change for 2011 since it has the same file format.

Yes, it works with Win7 (that's what I use.)

M.Jamal Khan
2010-05-16, 07:24 PM
v good dear nice sharing keep it up.
JAMAL

nathan.banks
2011-03-27, 10:54 PM
Great tip, but the only reason i wanted to open a DWG in read only is when the file isnt mine to edit, i just wish to review it. If the file is currently opened by another user, this batch file doesnt work - i get a cmd message saying "The process cannot access this file because it is being used by another process"

Obviously i can use Autocad's open read only way, but i was hoping this could be done by explorer.

Any help/suggestions?

edit- Im using winXP SP3 and the files are located on a server.

arshiel88
2011-03-29, 05:00 PM
In that case...




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 = 3
acadApp.Documents.Open cmd_arg(0), True


Save this to OpenReadOnly.vbs anywhere, say drive C.

Then the command under Application used to perform action: would be
wscript.exe C:\OpenReadOnly.vbs "%1"

Tested on local files in AutoCAD 2008 XP SP3 Platform. Please try if it will work on other versions and network files.