Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to add file type

Status
Not open for further replies.

danmul

Programmer
Jan 16, 2003
89
IE
Hi,
I have a script that adds a file type into the registry. my problem is that it needs to be run for each user that logs into the PC. Is it just as simple as an Admin user or is there another setting in the registry I need to set up.
Thanks in advance for any help.
daniel.

Here is install.cmd
assoc .ldf=StaticView
ftype StaticView=C:\GIV\StaticView.exe "%%1"
regedit /s staticview.reg

Here is staticview.reg:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\StaticView]
"EditFlags"=dword:00010000
"BrowserFlags"=dword:00000008
@="StaticView"

[HKEY_CLASSES_ROOT\StaticView\Shell]
@="C:\\GIV\\StaticView.exe,0" "%1"


 
Add to the logon script:

regedit /s staticview.reg
 
Hi,
Thanks for the reply. That is the last line if install.cmd. Should I have it placed somewhere else in the file.

Thanks,
Daniel.
 
Did you make certain that staticview.reg is also available to all users in the same logon directory?

In other words, regedit.exe is likely in that search paths at startup, but staticview.exe needs to be found by the logon script by copying it into the same directory as install.cmd


 
Hello all,

[1] If it is intended to be machine-wide file association, how about considering using startup script? Also, the script will be run in elevated privileges to access area where ordinary users do not have.
[2] The HKEY_CLASSES_ROOT hive is a derived registry branch. At startup, it would be "better"(?) to get to the HKLM branch to do the registry change. (Or if decided to use per-user based change, get to HKCU branch instead?)
[3] To make the deployment of new file association once, apply the startup script to a specifically created group of computers containing all machines if necessary. At the end of the script, run a commandline using cusrmgr to delete the 'very' computer running from the group, something like this:
[tt] cusrmgr -dlg groupname -m dcname -u domainname\%computername%$[/tt]

Just some ideas.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top