Author Topic: (vl-registry-read  (Read 11385 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7529
(vl-registry-read
« on: November 30, 2005, 10:37:30 AM »
How can I specify a wild card for this part of a registry key since it is different for each user?

(vl-registry-read "HKEY_USERS\\S-1-5-21-1645522239-861567501-725345543-1129\\......

Thanks,

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: (vl-registry-read
« Reply #1 on: November 30, 2005, 10:45:24 AM »
What application is generating it and what does it represent?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: (vl-registry-read
« Reply #2 on: November 30, 2005, 11:01:39 AM »
Ok .. I'll throw you a bone ....

You will need to know a couple of things before you can do what you want ...

You need to know the computer name and user name ... these can be retrieved from the system environment ...
USERDOMAIN = computer name
USERNAME = current user

Once you have those, put the two together in this fashion ...
"USERDOMAIN_USERNAME"

Now that you have that, you need to look for this registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Syncmgr\ProgressState\USERDOMAIN_USERNAME\SID

The value will be the number you are looking for.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

ronjonp

  • Needs a day job
  • Posts: 7529
Re: (vl-registry-read
« Reply #3 on: November 30, 2005, 11:08:52 AM »
So what I'm trying to do here is make a company wide etransmit setup that will etransmit a zipped up project into the current drawing directory in a folder called "Submittal mm-dd-yyyy. I want to be able to write to the DestFolder key. Any ideas on this?

Here is the whole path:

(vl-registry-read "HKEY_USERS\\S-1-5-21-1645522239-861567501-725345543-1129\\Software\\Autodesk\\AutoCAD\\R16.1\\ACAD-301:409\\ETransmit\\setups" )

Thanks,

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Andrea

  • Water Moccasin
  • Posts: 2372
Re: (vl-registry-read
« Reply #4 on: November 30, 2005, 11:38:44 AM »
So what I'm trying to do here is make a company wide etransmit setup that will etransmit a zipped up project into the current drawing directory in a folder called "Submittal mm-dd-yyyy. I want to be able to write to the DestFolder key. Any ideas on this?

Here is the whole path:

(vl-registry-read "HKEY_USERS\\S-1-5-21-1645522239-861567501-725345543-1129\\Software\\Autodesk\\AutoCAD\\R16.1\\ACAD-301:409\\ETransmit\\setups" )

Thanks,

Ron

if it's for all the same setting.....why not use the "C:\Documents and Settings\All Users\Desktop"  folder ?
Keep smile...

ronjonp

  • Needs a day job
  • Posts: 7529
Re: (vl-registry-read
« Reply #5 on: November 30, 2005, 01:36:47 PM »
How would one go about converting a string out of say ("testing") to "testing".

So I found listp kinda works but it give me this error:

(listp ("testing"))

; error: bad function: "testing"

thanks,

Ronl
« Last Edit: November 30, 2005, 01:41:35 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Andrea

  • Water Moccasin
  • Posts: 2372
Re: (vl-registry-read
« Reply #6 on: November 30, 2005, 01:53:18 PM »
How would one go about converting a string out of say ("testing") to "testing".

So I found listp kinda works but it give me this error:

(listp ("testing"))

; error: bad function: "testing"

thanks,

Ronl


(car (list "testing"))
Keep smile...

ronjonp

  • Needs a day job
  • Posts: 7529
Re: (vl-registry-read
« Reply #7 on: November 30, 2005, 03:25:12 PM »
Muchos Gracias Andrea! :-)

After further testng it still doesn't work  :x.
« Last Edit: November 30, 2005, 03:40:47 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: (vl-registry-read
« Reply #8 on: November 30, 2005, 03:53:32 PM »
What are you trying to do ... I provided you with the path to the session ID of the windows session currently active. You should be able to reach the path using that info ...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Bob Wahr

  • Guest
Re: (vl-registry-read
« Reply #9 on: November 30, 2005, 03:58:57 PM »
I've run into quite a few things that Autocad stores in the registry and loads into memory when the session starts so changes to the registry don't actually change until acad is closed and restarted.

Bob Wahr

  • Guest
Re: (vl-registry-read
« Reply #10 on: November 30, 2005, 04:04:47 PM »
With a little testing though, it looks to me like the key you want is
Code: [Select]
My Computer\HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R16.2\ACAD-4001:409\ETransmit\setups\{setupname (ie Standard)}\DestFoldermodified to match your computer of course..  Doing a manual change in the registry followed by an etransmit, worked on my maching.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: (vl-registry-read
« Reply #11 on: November 30, 2005, 04:07:54 PM »
Keith,

I did a search for the path you showed but it only went this far:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Syncmgr\

Then the next folder was "Handlers"

Thanks,

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ronjonp

  • Needs a day job
  • Posts: 7529
Re: (vl-registry-read
« Reply #12 on: November 30, 2005, 04:11:06 PM »
Bob you are correct.......sometimes I make things much harder than they need to be :)

I was already using this code for xref startup folders:

Code: [Select]
      (setq dwgpath  (strcat (getvar 'dwgprefix))
              profile (strcat (getvar 'cprofile))
              hkeyver (strcat "HKEY_CURRENT_USER\\Software\\Autodesk\\AutoCAD\\" "R" (substr (getvar 'acadver) 1 4))
              version (vl-registry-read hkeyver "CurVer")
              hkeyver (strcat "HKEY_CURRENT_USER\\Software\\Autodesk\\AutoCAD\\" "R" (substr (getvar 'acadver) 1 4) "\\" version "\\Profiles\\" profile "\\Dialogs\\")
       ) 

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

whdjr

  • Guest
Re: (vl-registry-read
« Reply #13 on: November 30, 2005, 04:23:57 PM »
How would one go about converting a string out of say ("testing") to "testing".

So I found listp kinda works but it give me this error:

(listp ("testing"))

; error: bad function: "testing"

thanks,

Ronl

How about 'read'?

Andrea

  • Water Moccasin
  • Posts: 2372
Re: (vl-registry-read
« Reply #14 on: November 30, 2005, 06:54:53 PM »
How about 'read'?

Wh...

this is the result.

Code: [Select]
AutoCAD menu utilities loaded.
Command: (read "testing")
TESTING

Command: (read (list "testing"))
; error: bad argument type: stringp ("testing")

Command: (read "testing")
TESTING

Command: (read ("testing"))
; error: bad function: "testing"

Command: (read '("testing"))
; error: bad argument type: stringp ("testing")

Command: (car (list "testing"))
"testing"
Keep smile...

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: (vl-registry-read
« Reply #15 on: December 01, 2005, 08:26:57 AM »
I don't know what you are trying to accomplish, or how you build your list. But if you want to extract a single string from a list, especially if the list has more than one element use this:

Code: [Select]
(setq mylist (list "1" "2" "3" "4" "5"))

(defun inlist (mytestval mylist / ndx)
(setq ndx 0)
(while (< ndx (length mylist))
 (setq myval (nth ndx mylist))
 (if (= myval mytestval)
  (setq ndx (length mylist))
  (progn
   (setq ndx (1+ ndx)
           myval nil)
  )
 )
 myval
)
)

The code returns the value if it is present, nil if it is not.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: (vl-registry-read
« Reply #16 on: December 01, 2005, 09:03:44 AM »
I must not understand what's required here because I don't see need for anything more than --

(car (member myItem myList))

Anyone? Bueller?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: (vl-registry-read
« Reply #17 on: December 01, 2005, 09:13:23 AM »
........................  zipped up project into the current drawing directory in a folder called "Submittal mm-dd-yyyy"

I'm not sure either Michael.

One thing though ..

I'd name the folders so they are sortable ie :

Submittal YYYY-mm-dd

.. and add a time based <24 hr clock> suffix, unless you are sure you wont have more that one submittal a day
 
Submittal YYYY-mm-dd-HHMM
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: (vl-registry-read
« Reply #18 on: December 01, 2005, 10:00:09 AM »
The trick that I am finding now is automating creation of the etransmit setup on each user machine. Any ideas on how to go about this?





Thanks,

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: (vl-registry-read
« Reply #19 on: December 01, 2005, 10:08:57 AM »
Are the paths the same? If they are, a simple registry file that is merged would solve the problem ..
Where do you want to do the work from? Is this supposed to be ran on the individual workstations or do you want to deploy it from a single computer via network registry connections. If you can do that, all you need to do is connect to the remote computer using the administration tools of the registry editor and merge the data.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

ronjonp

  • Needs a day job
  • Posts: 7529
Re: (vl-registry-read
« Reply #20 on: December 01, 2005, 10:18:17 AM »
Keith,

I tried merging the data via my startup batch file that uses a batch file.
Code: [Select]
regedit /S  "S:\-AutoCAD Routines-\registry.reg"
I keep getting different results....it always writes the reg data but sometimes the setup still won't show up in the Etransmit List?

Any thoughts on this?

Thanks,

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: (vl-registry-read
« Reply #21 on: December 01, 2005, 11:06:28 AM »
My first thought would be that while you are writing the data, the location of the data being written might be different on those systems. For example, the user might not be using that specific locale ID of software, It might be best to use the "CurVer" key (in HKLM) to extract the current version, then use that to find the locale ID from the CurVer key under that key (in HKLM not HKCU) ... once you have that data, you can then place the information in HKCU in the proper location. Also, you might look at the registry of an installation where it worked and one where it did not. There may be another entry in HKCU or HKLM that specifies which is the default setting for ETransmit.

for example, check under the setups item to see if there is anything in there.

I have attached a zip file containing a VBscript to get the AutoCAD installation information and display it to the user. If you look at how I did it htere, you might get a little bit of insight on how I would tackle it.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

ronjonp

  • Needs a day job
  • Posts: 7529
Re: (vl-registry-read
« Reply #22 on: December 01, 2005, 11:25:15 AM »
Thanks Keith....I'll take a look at this later and get back to you.

Thanks again,

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ronjonp

  • Needs a day job
  • Posts: 7529
Re: (vl-registry-read
« Reply #23 on: December 02, 2005, 09:53:19 AM »
This is what happened when I ran your script Keith:


Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: (vl-registry-read
« Reply #24 on: December 02, 2005, 10:08:01 AM »
Do you have administrative access to the registry on that computer?
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Bob Wahr

  • Guest
Re: (vl-registry-read
« Reply #25 on: December 02, 2005, 10:48:45 AM »
I'm guessing it can't open the key for read because the key doesn't exist.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: (vl-registry-read
« Reply #26 on: December 02, 2005, 10:57:21 AM »
Ok .. it might be that ... except in every installation of AutoCAD I have ever seen it is there ...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Bob Wahr

  • Guest
Re: (vl-registry-read
« Reply #27 on: December 02, 2005, 11:01:42 AM »
It's not on mine or any of the other installs in this office.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: (vl-registry-read
« Reply #28 on: December 02, 2005, 11:04:05 AM »
hmmm ... interesting ...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Bob Wahr

  • Guest
Re: (vl-registry-read
« Reply #29 on: December 02, 2005, 11:07:35 AM »
I have a CurVer key for acad under HKCU.  Perhaps a difference in install.  Are you using a license manager?  All mine are stand-alone installs.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: (vl-registry-read
« Reply #30 on: December 02, 2005, 11:57:22 AM »
Same here. Standalone installs and curver key is located under "HKEY_CURRENT_USER".

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ronjonp

  • Needs a day job
  • Posts: 7529
Re: (vl-registry-read
« Reply #31 on: December 02, 2005, 12:03:18 PM »
This works now:

Quote
Set WSHShell = WScript.CreateObject("WScript.Shell")
curver = WSHShell.RegRead ( "HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\curver")
locale = WSHShell.RegRead ( "HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\" & curver & "\curver")
serial = WSHShell.RegRead ( "HKEY_LOCAL_MACHINE\Software\Autodesk\AutoCAD\" & curver & "\" & locale & "\SerialNumber")
cprofile = WSHShell.RegRead ( "HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\" & curver & "\" & locale & "\Profiles\")
MsgBox "Current Version: " & curver & CRLF & "Locale Code: " & locale & CRLF & "Serial Number: " & serial & CRLF & "Current

Profile: " & cprofile, vbInformation + vbOKOnly, "AutoCAD Installation Information"

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: (vl-registry-read
« Reply #32 on: December 02, 2005, 12:12:21 PM »
All I have is stand alone ... perhaps it is a key left from upgrading from previous versions of AutoCAD .. as I have gone from R14 to R2000 to R2002 to R2004 .... or maybe it just isn't there in any AutoCAD 2006 installations ...interesting though .. very interesting
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Bob Wahr

  • Guest
Re: (vl-registry-read
« Reply #33 on: December 02, 2005, 12:15:30 PM »
Could be.  Most of the machines here were updated from 2002 but I did an uninstall of 2002 followed by a clean up of the registry.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: (vl-registry-read
« Reply #34 on: December 02, 2005, 12:41:56 PM »
I found this key under local machine here:

HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R16.1\ACAD-301:409\CadManagerControl\

hhhmmm

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Bob Wahr

  • Guest
Re: (vl-registry-read
« Reply #35 on: December 02, 2005, 12:43:38 PM »
Quote from: F1
To install the CAD Manager Control utility

Insert the CD or DVD, and double-click setup.exe.
In the Media Browser, Network Deployment tab, under Install Supplemental Tools, click Autodesk CAD Manager Tools 2.0.
Under Autodesk CAD Manager Tools 2.0, click Install.
After you install the CAD Manager Control utility, you access it from the Start menu (Windows). Information about how to use the utility is available in Help on the CAD Manager Control Utility window.
Might have to look into it.

cadpoobah

  • Newt
  • Posts: 48
Re: (vl-registry-read
« Reply #36 on: April 24, 2014, 12:15:42 PM »
How can I specify a wild card for this part of a registry key since it is different for each user?

(vl-registry-read "HKEY_USERS\\S-1-5-21-1645522239-861567501-725345543-1129\\......


Ron,

This thread took a detour from your original question. Did you ever get an answer to this? It would handy to know.

Thanks,
Chris Lindner
Onebutton CAD Solutions
----------------------------------------------------
www.onebuttoncad.com #dayjob
www.unpavedart.com    #sidehustle

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: (vl-registry-read
« Reply #37 on: April 24, 2014, 12:20:23 PM »
Quote from: cadpoobah
Ron,

This thread took a detour from your original question. Did you ever get an answer to this? It would handy to know.

Thanks,

Wasn't that answered in Reply #2?

ronjonp

  • Needs a day job
  • Posts: 7529
Re: (vl-registry-read
« Reply #38 on: April 24, 2014, 12:49:04 PM »
How can I specify a wild card for this part of a registry key since it is different for each user?

(vl-registry-read "HKEY_USERS\\S-1-5-21-1645522239-861567501-725345543-1129\\......


Ron,

This thread took a detour from your original question. Did you ever get an answer to this? It would handy to know.

Thanks,


Wow that was a long time ago! :) Today I'd grab the SID like so:
Code: [Select]
(defun _sid (/ key)
  (setq key "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\")
  (car (vl-remove-if-not
(function
   (lambda (x)
     (wcmatch (vl-registry-read (strcat key x) "ProfileImagePath") (getenv "userprofile"))
   )
)
(vl-registry-descendents key)
       )
  )
)
(_sid)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC