Once you set up SOLIDWORKS as desired, then you can export the registry keys. And then can set up to run the registry file (bat file) via Windows API on system start.
Bingo ! Deepak
edit: by the way, it'd be much easy in .NET which you do not need to call windows 32 API for registry get and save
When you manually run the .sldreg file it usually asks you a few questions before it restores. Is there a way to avoid questions?
Can you post a sample of the bat file?
Thank you very much.
Sorry don't have sample file and not sure how can you stop those pop-ups.
I have my own settings via API, mostly from system options (files location, templates etc) - I'm not sure if you can restore things like tab missing via API ?
I do have a few of the settings too pushed via API when I ran the product configurators on my machine, but I agree I think only the registry restore will do the trick like missing tabs...
ok, after playing with the batch/reg files, I come up with the following script that basically runs the SW_DefaultRegistry.bat file which fires the registry file SW_DefaultRegistry.reg every time I run our configurator app.
Solidworks *.sldreg files are same as *.reg file. you just need to rename extension.
' Restoring Registry every time app starts only for "SpecificMachine" machine
If (System.Environment.MachineName) = "SpecificMachine" Then
My.Computer.FileSystem.WriteAllBytes("C:\Users\Public\SW_DefaultRegistry.reg", My.Resources.SW_DefaultRegistryREG, False)
My.Computer.FileSystem.WriteAllBytes("C:\Users\Public\SW_DefaultRegistry.bat", My.Resources.SW_DefaultRegistryBAT, False)
SW_DefaultRegistry.bat file see below:
REM Registry restorer
REGEDIT /S C:\Users\Public\SW_DefaultRegistry.reg
I guess the bat file can be also added to AutoRun so it pushes the registry data when computer boots up.