Solved

login script for MS photo editor

Posted on 2010-09-07
12
298 Views
Last Modified: 2012-05-10
does anyone have a login script out there that sets jpeg, jpg, jpe, gif, etc to open in MS photo editor?
0
Comment
Question by:ordpeople
  • 6
  • 5
12 Comments
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
Take a look at FTYPE:    http://ss64.com/nt/ftype.html
0
 
LVL 8

Expert Comment

by:pvlier
Comment Utility
You need to edit the registry. You could do that by silently importing a reg file with the correct data. For example to set .jpg file:
- create reg file with this info (you can set info in regedit and then export and filter needed info):
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\jpegfile\shell\Open\command]
@="\"C:\\Program Files\\Common Files\\Microsoft Shared\\PhotoEd\\PHOTOED.EXE\" \"%1\""
"command"=hex(7):43,00,38,00,34,00,44,00,56,00,6e,00,2d,00,7d,00,66,00,28,00,\
  59,00,52,00,5d,00,65,00,41,00,52,00,36,00,2e,00,6a,00,69,00,50,00,68,00,6f,\
  00,74,00,6f,00,45,00,64,00,69,00,74,00,6f,00,72,00,46,00,69,00,6c,00,65,00,\
  73,00,3e,00,44,00,6f,00,54,00,5d,00,6a,00,49,00,7b,00,6a,00,66,00,28,00,3d,\
  00,31,00,26,00,4c,00,5b,00,2d,00,38,00,31,00,2d,00,5d,00,20,00,22,00,25,00,\
  31,00,22,00,00,00,00,00

- save this in the netlogon folder as 'fileasso.reg"
- add line to logon script: regedit /s \\<servername\netlogon\fileasso.reg
0
 

Author Comment

by:ordpeople
Comment Utility
could this be placed in HKCU?  I am looking for just two users to be able to open in photo editor.
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
That depends on the version of Windows you are using:

http://support.microsoft.com/kb/257592
0
 

Author Comment

by:ordpeople
Comment Utility
W2k3 SP2, I see that:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\jpegfile\shell\Open\command]
@="\"C:\\Program Files\\Common Files\\Microsoft Shared\\PhotoEd\\PHOTOED.EXE\" \"%1\""
"command"=hex(7):43,00,38,00,34,00,44,00,56,00,6e,00,2d,00,7d,00,66,00,28,00,\
 59,00,52,00,5d,00,65,00,41,00,52,00,36,00,2e,00,6a,00,69,00,50,00,68,00,6f,\
 00,74,00,6f,00,45,00,64,00,69,00,74,00,6f,00,72,00,46,00,69,00,6c,00,65,00,\
 73,00,3e,00,44,00,6f,00,54,00,5d,00,6a,00,49,00,7b,00,6a,00,66,00,28,00,3d,\
 00,31,00,26,00,4c,00,5b,00,2d,00,38,00,31,00,2d,00,5d,00,20,00,22,00,25,00,\
 31,00,22,00,00,00,00,00
works but not under HKCU.
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
From the site I pointed you to:

"Currently, there is no way through the UI to change or edit the user-specific file type associations stored in the HKEY_CURRENT_USER\SOFTWARE\Classes registry key. If you want to do this, you have to directly edit the registry or develop your own UI to gain access to this information. "

However, is this how you are trying to put it in HKCU?

[HKEY_CURRENT_USER\jpegfile\shell\Open\command]
@="\"C:\\Program Files\\Common Files\\Microsoft Shared\\PhotoEd\\PHOTOED.EXE\" \"%1\""
"command"=hex(7):43,00,38,00,34,00,44,00,56,00,6e,00,2d,00,7d,00,66,00,28,00,\
 59,00,52,00,5d,00,65,00,41,00,52,00,36,00,2e,00,6a,00,69,00,50,00,68,00,6f,\
 00,74,00,6f,00,45,00,64,00,69,00,74,00,6f,00,72,00,46,00,69,00,6c,00,65,00,\
 73,00,3e,00,44,00,6f,00,54,00,5d,00,6a,00,49,00,7b,00,6a,00,66,00,28,00,3d,\
 00,31,00,26,00,4c,00,5b,00,2d,00,38,00,31,00,2d,00,5d,00,20,00,22,00,25,00,\
 31,00,22,00,00,00,00,00
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 26

Expert Comment

by:pony10us
Comment Utility
An example of yusing ftype would be:

ftype jpegfile="C:\Program Files\Common Files\Microsoft Shared\PhotoEd\PHOTOED.exe" "%1"

You can find out what to use for each (if they are already set) by doing:

ftype | more

You can then scroll through and find each and make a text file with the current settings so that it would be easy to revert back.
0
 

Author Comment

by:ordpeople
Comment Utility
I have been trying a couple registry hacks:
[HKEY_CURRENT_USER\Software\Classes\jpegfile]
@="\"G:\\Program Files\\Common Files\\Microsoft Shared\\PhotoEd\\PHOTOED.EXE\" \"%1\""
also
[HKEY_CURRENT_USER\SOFTWARE\Classes\jpegfile\shell]

[HKEY_CURRENT_USER\SOFTWARE\Classes\jpegfile\shell\Open]
@="&Open"

[HKEY_CURRENT_USER\SOFTWARE\Classes\jpegfile\shell\Open\command]
@="\"G:\\Program Files\\Common Files\\Microsoft Shared\\PhotoEd\\PHOTOED.EXE\" \"%1\""
"command"=hex(7):31,00,30,00,21,00,21,00,21,00,67,00,78,00,73,00,66,00,28,00,\
  4e,00,67,00,5d,00,71,00,46,00,60,00,48,00,7b,00,4c,00,73,00,50,00,68,00,6f,\
  00,74,00,6f,00,45,00,64,00,69,00,74,00,6f,00,72,00,46,00,69,00,6c,00,65,00,\
  73,00,3e,00,44,00,6f,00,54,00,5d,00,6a,00,49,00,7b,00,6a,00,66,00,28,00,3d,\
  00,31,00,26,00,4c,00,5b,00,2d,00,38,00,31,00,2d,00,5d,00,20,00,22,00,25,00,\
  31,00,22,00,00,00,00,00

[HKEY_CURRENT_USER\SOFTWARE\Classes\jpegfile\shell\Print]
@="&Print"

[HKEY_CURRENT_USER\SOFTWARE\Classes\jpegfile\shell\Print\command]
@="\"G:\\Program Files\\Common Files\\Microsoft Shared\\PhotoEd\\PHOTOED.EXE\" /p \"%1\""
"command"=hex(7):31,00,30,00,21,00,21,00,21,00,67,00,78,00,73,00,66,00,28,00,\
  4e,00,67,00,5d,00,71,00,46,00,60,00,48,00,7b,00,4c,00,73,00,50,00,68,00,6f,\
  00,74,00,6f,00,45,00,64,00,69,00,74,00,6f,00,72,00,46,00,69,00,6c,00,65,00,\
  73,00,3e,00,44,00,6f,00,54,00,5d,00,6a,00,49,00,7b,00,6a,00,66,00,28,00,3d,\
  00,31,00,26,00,4c,00,5b,00,2d,00,38,00,31,00,2d,00,5d,00,20,00,2f,00,70,00,\
  20,00,22,00,25,00,31,00,22,00,00,00,00,00

[HKEY_CURRENT_USER\SOFTWARE\Classes\jpegfile\shell\printto]

[HKEY_CURRENT_USER\SOFTWARE\Classes\jpegfile\shell\printto\command]
@="G:\\PROGRA~1\\COMMON~1\\MICROS~1\\PhotoEd\\PHOTOED.EXE /pt \"%1\" \"%2\" \"%3\" \"%4\""
but don't seem to be getting anywhere.
0
 

Author Comment

by:ordpeople
Comment Utility
currently ftype reveals that jpegfile is associated with opening in IE which is how I want it for every user that logs onto the server, but want two users to be able to open in MS photo editor.
0
 
LVL 26

Accepted Solution

by:
pony10us earned 500 total points
Comment Utility
1. Copy the line currently shown by ftype to a text file.
2. Add ftype to the begining of the line
3. Copy the line:  ftype jpegfile="C:\Program Files\Common Files\Microsoft Shared\PhotoEd\PHOTOED.exe" "%1" to the text file

Since your original question was about doing this in a login script then you can place an if %username% line in the login script. I haven't tested this

if "%username%"=="user b" (
ftype jpegfile="C:\Program Files\Common Files\Microsoft Shared\PhotoEd\PHOTOED.exe" "%1"
goto cont:
)
if "%username%"=="user b"(
ftype jpegfile="C:\Program Files\Common Files\Microsoft Shared\PhotoEd\PHOTOED.exe" "%1"
goto cont:
)
 <ftype line from your text file wil the original association settings>
cont:
    rest of script

0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
The first if should be for "user a" instead of both being "user b"   oops!
0
 

Author Closing Comment

by:ordpeople
Comment Utility
ended up abondaning script because client moved on, but this helped us go down the path towards resolving it.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

This may not be a text book method to resolve VSS backup issues but it seemed to have worked on few of the Windows 2003 servers we had issues while performing a Volume Shadow Copy backup. If you have issues while performing a shadow copy backup usin…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now