Sign in to follow this  
Followers 0
cplusdummy

How to execute .exe INDIRECTLY trough another .exe, .bat etc...

32 posts in this topic

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!

Edited by cplusdummy
0

Share this post


Link to post
Share on other sites

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).

0

Share this post


Link to post
Share on other sites

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.

Edited by 5eraph
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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"

Edited by 5eraph
0

Share this post


Link to post
Share on other sites

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.

Edited by cplusdummy
0

Share this post


Link to post
Share on other sites

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. ;)

Edited by 5eraph
0

Share this post


Link to post
Share on other sites

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.

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

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.org/wiki/Windows_Messenger_service

which references

http://en.wikipedia.org/wiki/Microsoft_Messenger_service

0

Share this post


Link to post
Share on other sites

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...

0

Share this post


Link to post
Share on other sites

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

@ECHO OFF

START "" /WAIT NOTEPAD.EXE %1

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

jaclaz

Edited by jaclaz
0

Share this post


Link to post
Share on other sites

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!

0

Share this post


Link to post
Share on other sites

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 ;):

dictionary.gif

jaclaz

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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

@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!

Edited by cplusdummy
0

Share this post


Link to post
Share on other sites

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.net/utils/nircmd.html

instead.

Look for it's commands exec, exec2 and execmd

http://www.nirsoft.net/utils/nircmd2.html#using

jaclaz

0

Share this post


Link to post
Share on other sites

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

Okay,

http://www.squidoo.com/open-illustrator-files-in-maximized-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!

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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

CD C:\Users\Gunsmokingman\Desktop

echo %CD%

C:\Users\Gunsmokingman\Desktop

OpenNotepad.vbs TelusUpload.txt

0

Share this post


Link to post
Share on other sites

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

I'm really not familiar with windows scripting/programming but I have PHP knowledge so I added the /MAX parameter after /WAIT using some logic.

Now when I double click on .ai or .eps file the black box opens and remains open until the program completely processes/opens the file. After few seconds, once the file is opened and editable the box DISAPPEARS AUTOMATICALLY.

I don't know if this is how it's supposed to function but it's serving the purpose perfectly! :thumbup

0

Share this post


Link to post
Share on other sites

make batch file start C:\Windows\System32\Notepad.exe

then save as .bat and all files.

when you run it it'll open notepad

0

Share this post


Link to post
Share on other sites
make batch file start C:\Windows\System32\Notepad.exe

then save as .bat and all files.

when you run it it'll open notepad

You mean like was proposed by jaclaz in post#11??? :whistle:

You might want to read a thread to get the full gist first... ;)

( yeah, I've done the "repeat someone else" before... :blushing: )

0

Share this post


Link to post
Share on other sites

The only ways you can use a script is to associate a particular process with a specific file extension. (They are talking about double clicking on a .txt file)

If you want to have a script executed in this manner you'd need to re-associate .txt files on the end user's system with the scripting engine pertinent to the type of script you're invoking.

Your alternative is to create a script 'packaged/compiled' to an executable, name it notepad.exe in the location of your proper notepad.exe and use it to call that original notepad exe in its new location.

The problem with both those approaches is that that they are to be carried out on your end users PCs.

0

Share this post


Link to post
Share on other sites

Yzöwl , the OP already tested the proposed solution, modified it a little according to his needs and is using it successfully (for his needs):

Now when I double click on .ai or .eps file the black box opens and remains open until the program completely processes/opens the file. After few seconds, once the file is opened and editable the box DISAPPEARS AUTOMATICALLY.

I don't know if this is how it's supposed to function but it's serving the purpose perfectly! :thumbup

This thread (actualy the issue that originated it) was "closed" until DataCracker7899 revived it by re-posting (incompletely) the SAME info already posted in it.

jaclaz

0

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.