MSFN Forum: How to execute .exe INDIRECTLY trough another .exe, .bat etc... - MSFN Forum

Jump to content


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

How to execute .exe INDIRECTLY trough another .exe, .bat etc... An example... I'm telling Josh to tell Joe I'm going to be lat Rate Topic: -----

#1 User is offline   cplusdummy 

  • Newbie
  • Group: Members
  • Posts: 10
  • Joined: 10-February 13
  • OS:XP Pro x86
  • Country: Country Flag

Posted 10 February 2013 - 06:38 AM

Hello,

I'd like to do the following... For example, I have a file "data.txt" and by double clicking on it I'd like to send the request to another .exe, .bat, or whatever and call/redirect to the "real" .exe from there.

In other words I'd like to execute the C:\Windows\system32\notepad.exe INDIRECTLY and of corse I'd like for ALL .txt files to open this way.

An example... I'm telling Josh to tell Joe I'm going to be late! :)

Thank you!

This post has been edited by cplusdummy: 10 February 2013 - 06:40 AM



#2 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,418
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 10 February 2013 - 09:18 AM

May I ask you WHY?

In any case, change the file association to the .txt file to the *whatever* program you want to call instead of notepad.exe and make sure that this *whatever* actually calls notepad.exe.
See:
http://wstudios.home...iate/index.html

jaclaz

#3 User is offline   cplusdummy 

  • Newbie
  • Group: Members
  • Posts: 10
  • Joined: 10-February 13
  • OS:XP Pro x86
  • Country: Country Flag

Posted 10 February 2013 - 09:34 AM

Hi jaclaz,

I did not describe why because the answers would deteriorate from the question and people would post suggestions trying to solve the issue from different angles. Once solved I promise I'll describe the source of the problem.

As for your answer, yes I know how to handle file associates in widows. It's just a matter of Right Click --> Open With --> Choose Program --> Tap on "Always use the selected program..." --> Select Program or browse to it...

The problem is I don't have "Josh" (see my previous post).

#4 User is offline   5eraph 

  • Update Packrat
  • Group: Supreme Sponsor
  • Posts: 954
  • Joined: 04-July 05
  • OS:XP Pro x64
  • Country: Country Flag

Posted 10 February 2013 - 09:42 AM

Josh is his own person, unless he is a prisoner and you are a guard or the warden. It stands to reason that if Josh isn't with you, and you can't contact him, then you can't tell him anything.

Likewise, if we don't have an adequate grasp of the actual problem, there's no way we can tell you much of consequence.

This post has been edited by 5eraph: 10 February 2013 - 09:44 AM


#5 User is offline   cplusdummy 

  • Newbie
  • Group: Members
  • Posts: 10
  • Joined: 10-February 13
  • OS:XP Pro x86
  • Country: Country Flag

Posted 10 February 2013 - 09:49 AM

View Post5eraph, on 10 February 2013 - 09:42 AM, said:

Josh is his own person, unless he is a prisoner and you are a guard or the warden. It stands to reason that if Josh isn't with you, and you can't contact him, then you can't tell him anything.

Likewise, if we don't have an adequate grasp of the actual problem, there's no way we can tell you much of consequence.


True, that's why I'm asking you or anybody here to bring him to me :)

No, seriously I need to setup .txt files to trigger the whatever.exe (which I don't have) and redirect the request to notepad.exe.

#6 User is offline   5eraph 

  • Update Packrat
  • Group: Supreme Sponsor
  • Posts: 954
  • Joined: 04-July 05
  • OS:XP Pro x64
  • Country: Country Flag

Posted 10 February 2013 - 09:58 AM

Well, you could try setting it through a registry entry as Kai Liu has done for Notepad2.

HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\whatever.exe","Debugger",,"%10%\Notepad.exe"

This post has been edited by 5eraph: 10 February 2013 - 09:58 AM


#7 User is offline   cplusdummy 

  • Newbie
  • Group: Members
  • Posts: 10
  • Joined: 10-February 13
  • OS:XP Pro x86
  • Country: Country Flag

Posted 10 February 2013 - 11:17 AM

View Post5eraph, on 10 February 2013 - 09:58 AM, said:

Well, you could try setting it through a registry entry as Kai Liu has done for Notepad2.


You don't seem to understand my issue. I don't try to replace anything. I just want to run a .exe file indirectly. I DON'T HAVE the whatever.exe file! What I need to know is how to code a whatever.exe (or whatever.bat etc...) file that when it is called it calls another .exe file.

This post has been edited by cplusdummy: 10 February 2013 - 11:22 AM


#8 User is offline   5eraph 

  • Update Packrat
  • Group: Supreme Sponsor
  • Posts: 954
  • Joined: 04-July 05
  • OS:XP Pro x64
  • Country: Country Flag

Posted 10 February 2013 - 12:06 PM

As long as TXT files are already associated with whatever.exe, and you have that registry entry, then you shouldn't need whatever.exe. In this case Windows is Josh, and Joe is Notepad. ;)

This post has been edited by 5eraph: 10 February 2013 - 12:08 PM


#9 User is offline   submix8c 

  • Inconceivable!
  • Group: Patrons
  • Posts: 3,241
  • Joined: 14-September 05
  • OS:none specified
  • Country: Country Flag

Posted 10 February 2013 - 01:21 PM

I'm not going to swear by this, but I THINK that the OP want to somehow cause a TXT file to be "transmitted" to JOE via JOSH and "opened", very "similar" (stipulating with quotation marks) to the Windows Messaging System.

Quote

I'm telling Josh to tell Joe I'm going to be late

Question poser - WHY would you want an Intermediary for such a task? Is there a reason you can't "talk" to JOE directly? I see no purpose to "pushing" an EXE execution OP->JOSH->JOE unless the "purpose" is to run "whatever.exe" on JOE without JOE knowing it was the OP.

Sorry, but this is a REALLY strange "method" request and (no offense) smells a bit "fishy". Could you elaborate the purpose of this? Your first example doesn't square with

Quote

I need to setup .txt files to trigger the whatever.exe (which I don't have) and redirect the request to notepad.exe
YOU have the TXT file and want IT to "trigger" JOSH "whatever.exe" to "trigger" JOE "NOTEPAD.EXE" to display YOUR "TXT" on JOE??? Very odd! Just IM JOE, bearing in mind Windows Messaging is a favorite Service used by Spammers.
http://en.wikipedia....ssenger_service
which references
http://en.wikipedia....ssenger_service

#10 User is offline   cplusdummy 

  • Newbie
  • Group: Members
  • Posts: 10
  • Joined: 10-February 13
  • OS:XP Pro x86
  • Country: Country Flag

Posted 10 February 2013 - 01:52 PM

View Postsubmix8c, on 10 February 2013 - 01:21 PM, said:

YOU have the TXT file and want IT to "trigger" JOSH "whatever.exe" to "trigger" JOE "NOTEPAD.EXE" to display YOUR "TXT" on JOE???


E X A C T L Y!!! At last....

There is nothing fishy to it because I know this can be done simple. As I promised I'll tell you what is it for once solved. I just want to save myself from answers such as "why don't you try this and that instead...".

For example, I'm a PHP developer. I can call test.php indirectly by including it to info.php and calling http://www.example.com/info.php. I don't know why is this so hard to understand.

It does not have to be strictly a .exe file. I want to know how to call notepad.exe when double clicking on a .txt trough a second .exe, .bat or whatever...

#11 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,418
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 10 February 2013 - 03:12 PM

Do you mean something like (extremely simplified .cmd batch file):

Quote

@ECHO OFF
START "" /WAIT NOTEPAD.EXE %1


http://ss64.com/nt/start.html

jaclaz

This post has been edited by jaclaz: 10 February 2013 - 03:12 PM


#12 User is offline   submix8c 

  • Inconceivable!
  • Group: Patrons
  • Posts: 3,241
  • Joined: 14-September 05
  • OS:none specified
  • Country: Country Flag

Posted 10 February 2013 - 03:58 PM

Dude, here's your problem. Websites (and building a website) have Local or Remote (e.g. WWW) methods of "linking". I can see no way to "link into" ANOTHER person's PC the ANOTHER person's PC except via Remote (even if it's a Locally Connected PC).

You're looking at this from the perspective of the Web (as you say PHP coder). What you're asking for would be along the lines of a "hacker's delight". IOW, I defy you to do that by ANY means to my PC via My Brother's PC (who lives in the next state) unless I personally Initiated DIRECTLY from HIS PC after HE initiated from YOURS, all Remotely, understand (see last sentence)?

Bottom line - good luck to you as I see it as an "impossible task" UNLESS you write PROGRAM that can COMMUNICATE between the three (You, Josh, and Joe) AND the Firewall/Antivirus would ALLOW it (depending on the software). Routers act in the same way - BLOCKING certain In-Ports unless specifically opened. You're talking DIRECT TCP Communications and RUNNING a Program on a Remote. Consider this - HOW do you think "installing" an ActiveX works? The concept you want to conceptually achieve is the same. NOW also consider an IM program that TWO (or more) persons can Communicate with. THAT is essentially what you're asking for except via "script kiddie" methods, correct?

You LITERALLY need Open-ended "Read/Write" Access via TCP/IP between all three, TRANSMITTING to the Intermediary which would TRANSMIT to the END and RUN a Program to READ it.

Again, good luck!

#13 User is offline   5eraph 

  • Update Packrat
  • Group: Supreme Sponsor
  • Posts: 954
  • Joined: 04-July 05
  • OS:XP Pro x64
  • Country: Country Flag

Posted 10 February 2013 - 06:09 PM

For some reason, jaclaz has not yet responded as I would have expected. So I will.

#14 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,418
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 10 February 2013 - 06:26 PM

View Post5eraph, on 10 February 2013 - 06:09 PM, said:

For some reason, jaclaz has not yet responded as I would have expected. So I will.

Well, you'll have to pay a fee for re-using my aswers :whistle: and a fine for using them without my prior authorization. :ph34r:

Just like you cannot make up words ;):
Spoiler


jaclaz

#15 User is offline   submix8c 

  • Inconceivable!
  • Group: Patrons
  • Posts: 3,241
  • Joined: 14-September 05
  • OS:none specified
  • Country: Country Flag

Posted 12 February 2013 - 09:06 AM

@cplusdummy - School Project? :whistle: (google is my friend... sometimes)

#16 User is offline   cplusdummy 

  • Newbie
  • Group: Members
  • Posts: 10
  • Joined: 10-February 13
  • OS:XP Pro x86
  • Country: Country Flag

Posted 12 February 2013 - 02:58 PM

View Postjaclaz, on 10 February 2013 - 03:12 PM, said:

Do you mean something like (extremely simplified .cmd batch file):

Quote

@ECHO OFF
START "" /WAIT NOTEPAD.EXE %1


http://ss64.com/nt/start.html

jaclaz


jaclaz you're the MAN! Simple answer to a simple question!

As promised, here's why I needed this...

squidooDOTcom/open-illustrator-files-in-maximized-window

I don't want to include the the full link as it would be considered as spam and retyping the answer would be annoying.

Before you might think there must be a simpler solution for this... well, there is not! Googled it and people are reporting this problem to no avail.

Thank you everybody!

This post has been edited by cplusdummy: 12 February 2013 - 02:58 PM


#17 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,418
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 12 February 2013 - 03:29 PM

Well, your explanation is completely unlike an explanation :w00t: , post the full link if you want to explain something.

BTW that small batch will also open a command prompt window if double clicked or added to a context menu.

You might want to use a tool like nircmd:
http://www.nirsoft.n...ils/nircmd.html

instead.
Look for it's commands exec, exec2 and execmd
http://www.nirsoft.n...cmd2.html#using

jaclaz

#18 User is offline   cplusdummy 

  • Newbie
  • Group: Members
  • Posts: 10
  • Joined: 10-February 13
  • OS:XP Pro x86
  • Country: Country Flag

Posted 12 February 2013 - 04:32 PM

View Postjaclaz, on 12 February 2013 - 03:29 PM, said:

Well, your explanation is completely unlike an explanation :w00t: , post the full link if you want to explain something.


Okay,

http://www.squidoo.c...aximized-window

I'll edit the squidoo post tomorrow and link back to this discussion for compensation...

Yes, it opens the command prompt window but once the file opens it disappears.

Thanks again!

#19 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,418
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 12 February 2013 - 06:13 PM

View Postcplusdummy, on 12 February 2013 - 04:32 PM, said:

Yes, it opens the command prompt window but once the file opens it disappears.

With the /WAIT parameter? :unsure:

Even if it does, let me rephrase previous post as "a black box will either open (and remain open until you terminate the "target" program) or flash briefly on the screen, to avoid that use nircmd, INSTEAD" :whistle:

jaclaz

#20 User is online   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,351
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 12 February 2013 - 09:40 PM

I dont know if this is what he wants, but this hides the cmd promt window, just
drag and drop any file notepad can open,
Dim C34 :C34=Chr(34)
If WScript.Arguments.Count = 1 Then
 CreateObject("Wscript.Shell").Run("%Comspec% /C @Echo Off && Start " & _
 C34 & "" & C34 &"/Wait Notepad.exe " &WScript.Arguments(0)),0,True
End If 



Notepad.vbs in Cmd promt, open the text file

Quote

CD C:\Users\Gunsmokingman\Desktop
echo %CD%
C:\Users\Gunsmokingman\Desktop
OpenNotepad.vbs TelusUpload.txt


Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy