cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

How to get a company script to run when users double-click models and keep thumbnails!

jwagh
17-Peridot

How to get a company script to run when users double-click models and keep thumbnails!

Ok. This took me a while to work through and I though I would share it for others.

My goal was simple, avoid users from starting Creo without going through the company start-up script. This meant, that if they double-clicked a .asm or .prt... it would have to load the script and pass the file name through. Along with this, I wanted to keep the thumbnails that PTC Thumbnail viewer generates in Windows. The solution is to use the below code after running the silent install code:

The first portion of code changes the startup path for each extension class to the path of the startup script (RegOpenPath)

The class name (prtFile, asmFile, etc) was found by going to HKEY_CLASSES_ROOT in regedit and viewing the default data value

reg add "HKLM\SOFTWARE\Classes\prtFile\Shell\Open\Command" /ve /d "\"%RegOpenPath%\" \"%%1\"" /f >nul

reg add "HKLM\SOFTWARE\Classes\asmFile\Shell\Open\Command" /ve /d "\"%RegOpenPath%\" \"%%1\"" /f >nul

reg add "HKLM\SOFTWARE\Classes\drwFile\Shell\Open\Command" /ve /d "\"%RegOpenPath%\" \"%%1\"" /f >nul

reg add "HKLM\SOFTWARE\Classes\proeFile\Shell\Open\Command" /ve /d "\"%RegOpenPath%\" \"%%1\"" /f >nul

reg add "HKLM\SOFTWARE\Classes\dgmFile\Shell\Open\Command" /ve /d "\"%RegOpenPath%\" \"%%1\"" /f >nul

reg add "HKLM\SOFTWARE\Classes\frmFile\Shell\Open\Command" /ve /d "\"%RegOpenPath%\" \"%%1\"" /f >nul

reg add "HKLM\SOFTWARE\Classes\layFile\Shell\Open\Command" /ve /d "\"%RegOpenPath%\" \"%%1\"" /f >nul

reg add "HKLM\SOFTWARE\Classes\mfgFile\Shell\Open\Command" /ve /d "\"%RegOpenPath%\" \"%%1\"" /f >nul

reg add "HKLM\SOFTWARE\Classes\mrkFile\Shell\Open\Command" /ve /d "\"%RegOpenPath%\" \"%%1\"" /f >nul

reg add "HKLM\SOFTWARE\Classes\phaFile\Shell\Open\Command" /ve /d "\"%RegOpenPath%\" \"%%1\"" /f >nul

reg add "HKLM\SOFTWARE\Classes\psfFile\Shell\Open\Command" /ve /d "\"%RegOpenPath%\" \"%%1\"" /f >nul

reg add "HKLM\SOFTWARE\Classes\secFile\Shell\Open\Command" /ve /d "\"%RegOpenPath%\" \"%%1\"" /f >nul

The below code gives a name (RegOpenName) to your script so it can be viewed in Control Panel\All Control Panel Items\Default Programs\Set Associations

reg add "HKCR\Local Settings\Software\Microsoft\Windows\Shell\MuiCache" /v "%RegOpenPath%"  /d "%RegOpenName%" /f >nul


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
0 REPLIES 0
Top Tags