Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

login script for MS photo editor

Posted on 2010-09-07
12
305 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
ID: 33619607
Take a look at FTYPE:    http://ss64.com/nt/ftype.html
0
 
LVL 8

Expert Comment

by:pvlier
ID: 33619609
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
ID: 33620395
could this be placed in HKCU?  I am looking for just two users to be able to open in photo editor.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 26

Expert Comment

by:pony10us
ID: 33620507
That depends on the version of Windows you are using:

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

Author Comment

by:ordpeople
ID: 33621627
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
ID: 33621733
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
 
LVL 26

Expert Comment

by:pony10us
ID: 33622232
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
ID: 33622386
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
ID: 33622415
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
ID: 33622555
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
ID: 33622561
The first if should be for "user a" instead of both being "user b"   oops!
0
 

Author Closing Comment

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

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

860 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