Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 17974
Number of posts: 55343

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Get programs real name (no guessing) Posted by Archer282 on 8 Dec 2004 at 12:50 PM
I need a way to get the actual real name (including extension) of my program, and i dont mean by doing App.EXEName & ".exe"
what if its renamed to say .pif (the exe itself will work, but it get the wrong extension)
Report
Re: Get programs real name (no guessing) Posted by infidel on 8 Dec 2004 at 2:35 PM
: I need a way to get the actual real name (including extension) of my program, and i dont mean by doing App.EXEName & ".exe"
: what if its renamed to say .pif (the exe itself will work, but it get the wrong extension)

Why would it still work if someone renamed it to .pif? Wouldn't Windows look for an application registered to handle .pif files?


infidel

$ select * from users where clue > 0
no rows returned


Report
Re: Get programs real name (no guessing) Posted by Genjuro on 8 Dec 2004 at 3:14 PM
: : I need a way to get the actual real name (including extension) of my program, and i dont mean by doing App.EXEName & ".exe"
: : what if its renamed to say .pif (the exe itself will work, but it get the wrong extension)
:
: Why would it still work if someone renamed it to .pif? Wouldn't Windows look for an application registered to handle .pif files?
:
:
: infidel
:
:
: $ select * from users where clue > 0
: no rows returned
: 


The "GetModuleFileName" API *might* do; try it out and see.
Report
Re: Get programs real name (no guessing) Posted by Bulgarian_VB on 9 Dec 2004 at 7:18 PM
: : : I need a way to get the actual real name (including extension) of my program, and i dont mean by doing App.EXEName & ".exe"
: : : what if its renamed to say .pif (the exe itself will work, but it get the wrong extension)
: :
: : Why would it still work if someone renamed it to .pif? Wouldn't Windows look for an application registered to handle .pif files?
: :
: :
: : infidel
: :
: :
: : $ select * from users where clue > 0
: : no rows returned
: : 

:
: The "GetModuleFileName" API *might* do; try it out and see.
:
<filename> = App.EXEName
Dir(<filename> & ".*")


See what you get and decide which is most probable.

Hope I helped,
Nikolay Semov

Report
Re: Get programs real name (no guessing) Posted by Archer282 on 9 Dec 2004 at 7:40 PM
: : I need a way to get the actual real name (including extension) of my program, and i dont mean by doing App.EXEName & ".exe"
: : what if its renamed to say .pif (the exe itself will work, but it get the wrong extension)
:
: Why would it still work if someone renamed it to .pif? Wouldn't Windows look for an application registered to handle .pif files?
:
:
: infidel
:
:
: $ select * from users where clue > 0
: no rows returned
: 

:
:


.pif is the older extension for executables (stands for Program Information File) if you rename an exe to .pif it will still run under most version of windows.

just like .lnk even you have the option to show all known file extensions on, the extension wont be shown
Report
Re: Get programs real name (no guessing) Posted by Genjuro on 10 Dec 2004 at 1:39 AM
: : : I need a way to get the actual real name (including extension) of my program, and i dont mean by doing App.EXEName & ".exe"
: : : what if its renamed to say .pif (the exe itself will work, but it get the wrong extension)
: :
: : Why would it still work if someone renamed it to .pif? Wouldn't Windows look for an application registered to handle .pif files?
: :
: :
: : infidel
: :
: :
: : $ select * from users where clue > 0
: : no rows returned
: : 

: :
: :
:
:
: .pif is the older extension for executables (stands for Program Information File) if you rename an exe to .pif it will still run under most version of windows.
:
: just like .lnk even you have the option to show all known file extensions on, the extension wont be shown

.pif files are "Program Information Files" - a kind of config files used to specify older OS compatibility - they arent't EXEs by any mean.
Of course, this means also that calling App.Exename on a .pif will only run the EXE/COM with the same name, using the settings specified in the .pif file.
In fact, .pif files are created from Explorer when under "properties", you modify default settings for an older-Windows EXE - ie: specifying that it should run in Win95 compatibility, or fullscreen.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.