Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 09-22-2012, 12:23 AM
stoker stoker is offline
Junior Member
 
Join Date: Jun 2012
Posts: 13
Default Run the program without extension

If I rename program.exe, removing .exe and run it with this command:

Code:
ShellExecute(Handle, pChar('open'), pChar('program'), nil, nil, SW_SHOWNORMAL);
does not work, however if I run it with a file .bat with this code:

Code:
program
working, why? Sorry for my bad English.
Reply With Quote
  #2  
Old 09-22-2012, 10:20 AM
Donovan Donovan is offline
Senior Member
 
Join Date: Jan 2011
Posts: 150
Send a message via Skype™ to Donovan
Default

Why would you ever need to do something like that?
Reply With Quote
  #3  
Old 09-24-2012, 08:24 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,307
Default

Because it's SHELLexecute ???
Windows executes based on extensions, check out your registry for that

Perhaps cmd executes using CreateProcess or something like that, but nevertheless, why would you even consider removing an extension???
Reply With Quote
  #4  
Old 09-24-2012, 07:33 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,059
Default

I totally agree with that.
__________________
Regards,
Abdulaziz Jasser
Reply With Quote
  #5  
Old 09-25-2012, 06:51 PM
nester261 nester261 is offline
Moderator
 
Join Date: Jan 2004
Location: UK
Posts: 618
Default

The only reason I have ever had for doing this was to send self extracting archives through certain email providers. Gmail being one of the worst as they even detected an exe in a rar file, strangely enough using cab format is fine, or at least it was when I last tried.
__________________
"Where there's a will, there's always a way."

-- The Hon Robert Nester Marley O.M. - aka Bob Marley!
Reply With Quote
  #6  
Old 09-25-2012, 08:44 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,059
Default

I am so interesting in hearing more about this. In fact I have multiple accounts including Gmail, Hotmail (Microsoft) and some other email providers and I can see some stupide differences. I will be very thankful if you can tell more.
__________________
Regards,
Abdulaziz Jasser
Reply With Quote
  #7  
Old 09-26-2012, 04:48 AM
nester261 nester261 is offline
Moderator
 
Join Date: Jan 2004
Location: UK
Posts: 618
Default

I have just retested them again as it was back in 2010 when I last needed to do this. My program would generate an encrypted archive using FlexCompress by ComponentAce, it needed to be Self Extracting so the user could be prompted by a password. It never made it to release but I would like to revive it some day and clean it up more. I had the options set so the user could decide to send it in any of the 5 different formats tested below.

I have tested Gmail, Yahoo Mail and Hotmail...

Gmail Test:

EXE File: --> No (After 10 minutes received illegal attachment warning).
CAB File: --> Yes
No Ext: --> Yes
Renamed Ext: --> Yes
ZIP: --> No (Received illegal attachment warning, instantly).

Yahoo Mail Test:

EXE File: --> Yes!
CAB File: --> Yes
No Ext: --> Yes
Renamed Ext: --> Yes
ZIP: --> Yes

Hotmail Test:

EXE File: --> No (Blocked Attachment... No warning sent to sender).
CAB File: --> Yes
No Ext: --> Yes
Renamed Ext: --> Yes
ZIP: --> Yes

//---

Cabinet files still seem to be the best way.

The most annoying thing I remember was the alternate data streams that got added after the attachment got back home.
__________________
"Where there's a will, there's always a way."

-- The Hon Robert Nester Marley O.M. - aka Bob Marley!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 11:45 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.