startapp windows explorer; can not open directory with comma

startapp windows explorer; can not open directory with comma

adrian_cruz-pc
Contributor Contributor
513 Views
3 Replies
Message 1 of 4

startapp windows explorer; can not open directory with comma

adrian_cruz-pc
Contributor
Contributor

Hello,

 

Checked the forums and couldn't find the answer (maybe I'm just not good with searching the forum?).

 

Using the standard (STARTAPP (strcat "EXPLORER /e," (getvar "dwgprefix"))) to open the directory of my drawing file.

 

Problem is when there is a comma in the path the routine will not work. Any solutions to opening directories that contain comma's?

 

Thx in advance.

0 Likes
Accepted solutions (1)
514 Views
3 Replies
Replies (3)
Message 2 of 4

adrian_cruz-pc
Contributor
Contributor
Accepted solution

After looking, and many google searches. I found the solution to my own problem. I prefer using "dir" for my command input.

 

standard function:

(defun c:dir ()
(startapp "explorer" (strcat "/n,/e," (getvar "dwgprefix")))
)(princ)

 

Modified to open folders with comma's:

(defun c:dir ()
(startapp "explorer" (strcat "/n,/e," """\""(getvar "dwgprefix")))
)(princ)

 

0 Likes
Message 3 of 4

TomBeauford
Advisor
Advisor

Odd, I've used this macro:

Name            Explore Here...

Description  Open Windows Explorer in Drawing Directory

Macro            ^C^C^P(progn(startapp "explorer" (strcat "/n,/e," (getvar "dwgprefix")))(princ)) 

Image            ExplorerBBox.png (attached)

and never had a problem with spaces in directories.

64bit AutoCAD Map & Civil 3D 2023
Architecture Engineering & Construction Collection
2023
Windows 10 Dell i7-12850HX 2.1 Ghz 12GB NVIDIA RTX A3000 12GB Graphics Adapter
0 Likes
Message 4 of 4

Shneuph
Collaborator
Collaborator

Thank you for sharing.  I've had this issue for years with a lisp that we use.  However, we never came across it often enough to really bother anything.  Now, I've updated it with your lines and works great!

 

Much appreciated.

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)