All air code but something like this VBScript may work.
Dim WshShell, user
Set WshShell=WScript.CreateObject("WScript.Shell")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colComputer
user = objComputer.UserName
Next
WshShell.RegWrite "HKCU\Software\Autodesk\" _
& "AutoCAD\R16.1\ACAD-301:409\Profiles\" _
& user & "\Menus", "SomeValue", REG_SZ"
Set WshShell=Nothing
--
Regards,
Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"Gordon" wrote:
| I'm attempting to setup a generic profile file (REG file) that I can
| use to simplify my software setup tasks, in this case, AutoCAD 2005.
|
| In an ARG file (an AutoCAD user profile which is nearly identical in
| structure to a REG file) that is dumped for a specific user after
| AutoCAD is setup for example, you'll see registry KEY entries similar
| this one:
|
|
[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R16.1\ACAD-301:409\Profiles\Gordon\Menus]
|
| Now when making a batch file script (*.bat file), I know I can use
| %USERNAME% to plugin the current user name for batch file commands.
|
|
|
| Can someone more knowledgable than I tell me if this will work:
|
|
[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R16.1\ACAD-301:409\Profiles\%USERNAME%\Menus]
|
|
| It would sure be cool (and save me a bunch of time) if I could create
| one master REG file that could be applied to any given user, without
| having to manually modify the REG file for each user, right after I
| finish the Acad install, and have all my network pointers and custom
| menus in place. This trick could be applied to other software as
| well....
|
| How do I get a registry key entry in a REG file, like the one above, to
| plugin the user name?
|
|
| Or, maybe I'm going about this the wrong way.... Comments welcome!
|
| Thanks
| Gordon
|