associate file types for everyone in terminal servers
How do I associate Tif file to Microsoft Office Document Imaging? I need to associate for everyone that logs into this server... When I log in as administrator and associate it, it only does it for me... is there reg hack or something?
Windows Server 2003Microsoft Legacy OS
Last Comment
Serge Fournier
8/22/2022 - Mon
Serge Fournier
this is an example where i associate iso with daemon tools in logon script
if you have a logon script in your domain, then it will also run for every user on terminal server
to access thoses registry keys, either your script must run BEFORE use log, with machine right (a gpo can do that)
or your users must have some permissions to do so (by default they do not, if not in local admin group)
you can also put the script in all users startup if it's not in a domain
obviously, this is not a top answer :P
just copy past from my work, so change what you want
Set objshe = WScript.CreateObject("WScript.Shell")set objEnv = objshe.Environment("PROCESS")Set objFSO = wscript.CreateObject("Scripting.FileSystemObject")Set objNet = CreateObject("WScript.Network") set objsheapp = wscript.CreateObject("Shell.Application")Set objaut = WScript.CreateObject("AutoItX.Control")Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") f=prodir32 & "\daemon tools" e="\daemon.exe" if objFSO.fileEXISTS(f & e) then a =f & e d = f end if b="iso" c=runwit(a &" -mount 0, ""%l""",b,"imagecd" & b)'======= register a certain extension to run with a certain programfunction runwit(runwitprog, runwitext, runwitnam) runwita="HKEY_CLASSES_ROOT\."& runwitext &"\" runwitb=runwitnam runwitc="REG_SZ" runwitd=regwri(runwita,runwitb,runwitc) runwita="HKEY_CLASSES_ROOT\"& runwitnam &"\" runwitb=runwitnam runwitc="REG_SZ" runwitd=regwri(runwita,runwitb,runwitc) runwita="HKEY_CLASSES_ROOT\"& runwitnam &"\shell\open\command\" runwitb=runwitprog runwitc="REG_SZ" runwitd=regwri(runwita,runwitb,runwitc)end function'====== write a value in registry, trap errorfunction regwri(regkey, value, type01) if type01<>"" then on error resume next objshe.RegWrite regkey,value,type01 else objshe.RegWrite regkey,"" end if if err.number<>0 then 'msgfin = msgfin & "`n" & regkey & "`n" toterrcop = toterrcop + 1 msgfin03 = msgfin03 & vbcrlf & "error - register base not written: " & vbcrlf & regkey & vbcrlf & err.description & vbcrlf if usenam = debugname then msgbox("cannot write key" & vbcrlf & regkey & vbcrlf & value) end if end ifend function
you can see in my script where the file association are in register base:
HKEY_CLASSES_ROOT
so change the path and file name for the program you want tif to be associated with
path to the file .exe:
f=prodir32 & "\daemon tools"
e="\daemon.exe"
save as VBS
execute
It will write it in a section in registry that is used for ALL users (pretty sure about that)
i was suggesting the logon technique just to configures all computer in a network
but for a terminal server it's not necessary
if you have a logon script in your domain, then it will also run for every user on terminal server
to access thoses registry keys, either your script must run BEFORE use log, with machine right (a gpo can do that)
or your users must have some permissions to do so (by default they do not, if not in local admin group)
you can also put the script in all users startup if it's not in a domain
obviously, this is not a top answer :P
just copy past from my work, so change what you want
Open in new window