Solved

login script for MS photo editor

Posted on 2010-09-07
12
308 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
[X]
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
  • 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
Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Organizations create, modify, and maintain huge amounts of data to help their businesses earn money and generally function.  Typically every network user within an organization has a bit of disk space to store in process items and personal files.   …
I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

742 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