d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > File Type Icon Question
Add Reply New Topic New Poll
Member
Posts: 3,706
Joined: Mar 8 2009
Gold: 17,175.10
Dec 17 2012 11:33am
I have a few questions.
-I am sending out a client project for work via DVD and currently the file type AND the icon for all of my recorded training modules are .wmv however I would like to change the icon so that when I send these documents out on the DVD they display our bug.jpg instead of the .wmv icon.

I know I can change MY icon so that the default icon for MY .wmv files displays out bug.jpg but im not too sure if I can do that across platforms. I guess if the answer to this is "no" I cannot change the icon cross platform, then thanks- that is all. Otherwise....

Any suggestions on how to do this?

I cannot find exactly what I need in google and I feel unproductive scouring pages 2 and beyond.. Obviously the brilliant JSP community has more functionality than google, or possibly better metacrawling skills than I. Thanks a bunch for everyone's time.. We all appreciate it!
Member
Posts: 16,144
Joined: Mar 27 2008
Gold: 14,618.00
Dec 17 2012 02:40pm
I guess what you search is first link on google for: "autorun inf dvd"

Here it is: http://www.phdcc.com/shellrun/autorun.htm

This post was edited by Richter on Dec 17 2012 02:40pm
Member
Posts: 10,812
Joined: Oct 15 2009
Gold: Locked
Warn: 20%
Dec 17 2012 07:35pm
Quote (TheDiscoveryChannel @ Dec 17 2012 10:33am)
I have a few questions.
-I am sending out a client project for work via DVD and currently the file type AND the icon for all of my recorded training modules are .wmv however I would like to change the icon so that when I send these documents out on the DVD they display our bug.jpg instead of the .wmv icon.

I know I can change MY icon so that the default icon for MY .wmv files displays out bug.jpg but im not too sure if I can do that across platforms. I guess if the answer to this is "no" I cannot change the icon cross platform, then thanks- that is all. Otherwise....

Any suggestions on how to do this?

I cannot find exactly what I need in google and I feel unproductive scouring pages 2 and beyond.. Obviously the brilliant JSP community has more functionality than google, or possibly better metacrawling skills than I. Thanks a bunch for everyone's time.. We all appreciate it!


when you say cross platform do you mean "on other windows machines"? or do you mean "on linux, unix, windows, and macs"?

Member
Posts: 10,812
Joined: Oct 15 2009
Gold: Locked
Warn: 20%
Dec 18 2012 12:04am
well you could create a shortcut to your media, then put an icon on that shortcut, but if its not a normal system icon, you will have to include the icon with the dvd, additionally you will have to craft the target path for the shortcut and icon so it uses relative references, (if you link it as D:\myvideo.wmv, and the dvd gets mounted as E:, it won't work). Maybe you can use environmental variables to do this, never tried.

/e on second thought, would prob be simpler to just write an tiny application that launched the video when executed, and just embed the icon in it

This post was edited by Azrad on Dec 18 2012 12:10am
Member
Posts: 3,706
Joined: Mar 8 2009
Gold: 17,175.10
Dec 19 2012 09:13am
Quote (Azrad @ Dec 17 2012 05:35pm)
when you say cross platform do you mean "on other windows machines"? or do you mean "on linux, unix, windows, and macs"?



I mean "on other windows machines". So what I want to do is put these .wmv files onto a DVD however when the user opens the DVD instead of the .wmv icons they see the icon of my choice.
Member
Posts: 3,706
Joined: Mar 8 2009
Gold: 17,175.10
Dec 19 2012 09:14am
Quote (Azrad @ Dec 17 2012 10:04pm)
well you could create a shortcut to your media, then put an icon on that shortcut, but if its not a normal system icon, you will have to include the icon with the dvd, additionally you will have to craft the target path for the shortcut and icon so it uses relative references, (if you link it as D:\myvideo.wmv, and the dvd gets mounted as E:, it won't work). Maybe you can use environmental variables to do this, never tried.

/e on second thought, would prob be simpler to just write an tiny application that launched the video when executed, and just embed the icon in it



My programming experience is limited to c and beginner python.. I'm learning quickly though and I think this is probably something to at least investigate, thank you.
Member
Posts: 3,706
Joined: Mar 8 2009
Gold: 17,175.10
Dec 19 2012 09:17am
Quote (Richter @ Dec 17 2012 12:40pm)
I guess what you search is first link on google for: "autorun inf dvd"

Here it is: http://www.phdcc.com/shellrun/autorun.htm



This is a very good link, and tons of useful information; however I would not have thought to search for this, which is for sure why I did not find it! Fresh perspectives always help. Thank you very much.
Member
Posts: 10,812
Joined: Oct 15 2009
Gold: Locked
Warn: 20%
Dec 19 2012 09:50am
Quote (TheDiscoveryChannel @ Dec 19 2012 08:14am)
My programming experience is limited to c and beginner python.. I'm learning quickly though and I think this is probably something to at least investigate, thank you.


well this is really quick and dirty python but here goes:

Code
import os
import sys

os.startfile(os.path.dirname(sys.argv[0]) + '\\videos\\s9sabotage.mp4')


os.path.dirname(sys.argv[0]) --> is the path to the directory where this script/file was executed from... so if its on the top directory structure of the DVD it will be something like E:... this is how you deal with the fact that you won't know what drive letter the DVD will be assigned

\\videos\\s9sabotage.mp4 --> is the path to video i tested it on... its in a folder called "videos", below the initial script/file

os.startfile will open the file with the default application associated with it (in my case it was vlc media player).

os.startfile only works on windows family os's (xp and later).

Since you can't expect your users to have python installed you will have to package this with something like py2exe or pyinstaller. Then use a third party application (or possible use the packager, py2exe or pyinstaller they do have options for including an icon) to embed your icon into this resulting exe (make sure to include multiple sizes of the icon, to cover different folder settings on your users machines).

script does not require admin permissions

I'm sure there is a more elegant way to do this, but this is what I could think of :blush:

/e to recap the directory structure:

its something like
E:\thiscode.py
or after you package it into an exe:
E:\thiscode.exe
and
E:\videos\s9sabotage.mp4

This post was edited by Azrad on Dec 19 2012 10:00am
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 19 2012 09:54am
Quote (Azrad @ Dec 19 2012 10:50am)
well this is really quick and dirty python but here goes:

Code
import os
import sys

os.startfile(os.path.dirname(sys.argv[0]) + '\\videos\\s9sabotage.mp4')


os.path.dirname(sys.argv[0]) --> is the path to the directory where this script/file was executed from... so if its on the top directory structure of the DVD it will be something like E:... this is how you deal with the fact that you won't know what drive letter the DVD will be assigned

\\videos\\s9sabotage.mp4 --> is the path to video i tested it on... its in a folder called "videos", below the initial script/file

os.startfile will open the file with the default application associated with it (in my case it was vlc media player).

os.startfile only works on windows family os's (xp and later).

Since you can't expect your users to have python installed you will have to package this with something like py2exe or pyinstaller. Then use a third party application to embed your icon into this resulting exe (make sure to include multiple sizes of the icon, to cover different folder settings on your users machines).

script does not require admin permissions

I'm sure there is a more elegant way to do this, but this is what I could think of  :blush:


you can't just use a bat file?
Member
Posts: 10,812
Joined: Oct 15 2009
Gold: Locked
Warn: 20%
Dec 19 2012 09:59am
Quote (carteblanche @ Dec 19 2012 08:54am)
you can't just use a bat file?


yeah but i don't think you can embed a custom icon into a bat file and then move it to another machine and have the icon show up.... same with a shortcut (.lnk).
But I could be totally wrong, icon's are not my strong suit... If it is possible, I got no idea how to do it.

This post was edited by Azrad on Dec 19 2012 10:02am
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll