Computer Hope

Microsoft => Microsoft DOS => Topic started by: floridian2005 on June 15, 2007, 04:56:58 AM

Title: question on creating a batch file
Post by: floridian2005 on June 15, 2007, 04:56:58 AM
Hi,

I would like to start a different application (say B.exe) automatically when I start one application (say A.exe) ? If I had to write a batch file for doing this, how would I do it? Appreciate your help very much. Thanks in advance.
Title: Re: question on creating a batch file
Post by: Carbon Dudeoxide on June 15, 2007, 05:21:07 AM
So do you mean something like this: When you open Microsoft Word, it opens Microsoft Excel as well as Word. (examples)
Title: Re: question on creating a batch file
Post by: floridian2005 on June 15, 2007, 07:21:23 AM
yes, exactly
Title: Re: question on creating a batch file
Post by: Carbon Dudeoxide on June 15, 2007, 07:56:32 AM
I don't think thats possible with a batch file...or any program/programming languages I know of. You can start 2 programs with a batch file but it can't do what you're trying to do.
Title: Re: question on creating a batch file
Post by: contrex on June 15, 2007, 08:37:51 AM
floridian, if you write a batch file like this

Code: [Select]
start "" "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE"
start "" "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE"

You need to check the exact program paths, they may be different.

So you see the syntax of the start command would be

start "" "path to\program file1.exe"
start "" "path to\program file2.exe"

etc




When you run it, both programs will start

Title: Re: question on creating a batch file
Post by: Carbon Dudeoxide on June 15, 2007, 08:44:24 AM
Yes, and you can convert this to an EXE with the icon of the origional application so whenever you click this exe, it launches two programs.
Title: Re: question on creating a batch file
Post by: ghostdog74 on June 15, 2007, 08:52:10 AM
I don't think thats possible with a batch file...or any program/programming languages I know of. You can start 2 programs with a batch file but it can't do what you're trying to do.
yes, you can't do that in DOS but if OP is really opening Excel to open Word to do something, it can be done using macros.
Code: [Select]
Sub TestCallFromExcel()
    Dim wdApp As Word.Application
    Set wdApp = New Word.Application
    With wdApp
        'Open Word document
        .Documents.Open Filename:="C:\temp\test.doc"
        .Visible = True
        With .Selection
            .TypeText ("testing 1234")
        End With
        .ActiveDocument.Save
        'Exit Word
        .Quit
    End With
        'Release object variable
    Set wdApp = Nothing
End Sub

and then you can call "start myexcel.xls" to start both excel and word.
Title: Re: question on creating a batch file
Post by: contrex on June 15, 2007, 08:55:00 AM
Yes, and you can convert this to an EXE with the icon of the origional application so whenever you click this exe, it launches two programs.

How are you converting batches to exes, dudeoxide?

Title: Re: question on creating a batch file
Post by: contrex on June 15, 2007, 08:56:32 AM
ghostdog, Word and Excel were just 2 examples of programs suggested by dudeoxide. The OP asked a general question.

Title: Re: question on creating a batch file
Post by: Carbon Dudeoxide on June 15, 2007, 09:05:07 AM
Yes, and you can convert this to an EXE with the icon of the origional application so whenever you click this exe, it launches two programs.
How are you converting batches to exes, dudeoxide?
I have a program Admin posted a few months ago. Very nice little program. You can add version info and a custom icon and stuff.

If you or the OP or anyone wants it, i'll post it here.
Title: Re: question on creating a batch file
Post by: ghostdog74 on June 15, 2007, 09:07:07 AM
ghostdog, Word and Excel were just 2 examples of programs suggested by dudeoxide. The OP asked a general question.


yes i know, thanks. I quote myself
Quote
....but if OP is really opening Excel to open Word to do something....
Title: Re: question on creating a batch file
Post by: floridian2005 on June 15, 2007, 10:12:45 AM
Thank you all very much for the responses. No, it isn't Word and Excel that I need to open.

But there is an application, which when I run, needs to have this other container app started and running already. A friend had mentioned long ago that he had created something (i remember him saying a "batch" file) so, as soon as he tried running the app, it first started off the container app..so no complaints and no need to remember to start it each time.

So I was wondering how he might have accomplished that....thanks again!
Title: Re: question on creating a batch file
Post by: Carbon Dudeoxide on June 15, 2007, 09:26:28 PM
Maybe it's what Contrex posted. Perhaps your fiend clicked the batch file and the two programs started simultaneously
Title: Re: question on creating a batch file
Post by: only_lonely on June 18, 2007, 07:20:58 PM

[/quote]
I have a program Admin posted a few months ago. Very nice little program. You can add version info and a custom icon and stuff.

If you or the OP or anyone wants it, i'll post it here.
[/quote]
so where to get the program to convert it?
Title: Re: question on creating a batch file
Post by: Dark Blade on June 18, 2007, 07:30:24 PM
Is it bat2exe (http://www.computerhope.com/download/utility/bat2exe.com), by any chance?
Title: Re: question on creating a batch file
Post by: Carbon Dudeoxide on June 18, 2007, 09:32:14 PM
bat2exe is outdated...

It's 2MB so I can't attach it below.

Click HERE (http://www.fileupyours.com/files/107234/Batch%20to%20EXE%20converter.zip) for it.
Title: Re: question on creating a batch file
Post by: Fen_Li on June 19, 2007, 02:10:34 PM
More Powerfull (Best) Batch Compiler I've Found :

grab on http://www.abyssmedia.com/downloads/quickbfc.exe
this stuff is free trial.so, you must purchase or crack it..
 ;D ;D
Title: Re: question on creating a batch file
Post by: Carbon Dudeoxide on June 20, 2007, 02:41:31 AM
More Powerfull (Best) Batch Compiler I've Found :

grab on http://www.abyssmedia.com/downloads/quickbfc.exe
this stuff is free trial.so, you must purchase or crack it..
 ;D ;D
Have you tried mine?
It's free and you can add icons and file information.
FYI, We don't post or direct people to cracks.
Free trials usually add something in the beginning like
echo. This was compiled by softwarename.
pause
Title: Re: question on creating a batch file
Post by: ghostdog74 on June 20, 2007, 02:54:51 AM
why are you all so obsessed with batch compilers (which most probably would not even work) when the OP has not even specified he wants it.
Title: Re: question on creating a batch file
Post by: contrex on June 20, 2007, 03:04:53 AM
agreed. Their only use is to hide code from the user (or victim!). They are just toys.
Title: Re: question on creating a batch file
Post by: Dark Blade on June 20, 2007, 03:14:04 AM
why are you all so obsessed with batch compilers (which most probably would not even work) when the OP has not even specified he wants it.

Because contrex asked him about it.

How are you converting batches to exes, dudeoxide?
Title: Re: question on creating a batch file
Post by: ghostdog74 on June 20, 2007, 03:24:02 AM
Because contrex asked him about it.
no its because dude posted an irrelevant reply.
Quote from: Carbon dudeoxide
Yes, and you can convert this to an EXE with the icon ....
Title: Re: question on creating a batch file
Post by: reaper_tbs on June 20, 2007, 03:29:51 AM
nice attention span.. did it come with the cereal?

It's not irrelevant. read the previous posts a few times. there is significance...
Title: Re: question on creating a batch file
Post by: Dark Blade on June 20, 2007, 03:34:02 AM
nice attention span.. did it come with the cereal?

It's not irrelevant. read the previous posts a few times. there is significance...
Quote from: contrex
They are just toys
Connection?

And this topic is resolved, BTW.



Because contrex asked him about it.
no its because dude posted an irrelevant reply.
Quote from: Carbon dudeoxide
Yes, and you can convert this to an EXE with the icon ....
Well, Dudeoxide's post was kinda relevant:
Quote
Yes, and you can convert this to an EXE with the icon of the origional application so whenever you click this exe, it launches two programs.

So maybe that OP's friend made a batch file that loaded both of them, and made it .exe and changed icon, so that he didn't have to remember to open both of them.
Title: Re: question on creating a batch file
Post by: reaper_tbs on June 20, 2007, 03:37:42 AM
you like contradicting yourself don't you? :P

first you say
Quote from: Dark Blade
Connection?

then you say..
Quote from: Dark Blade
Well, Dudeoxide's post was kinda relevant

that was my point ;)
Title: Re: question on creating a batch file
Post by: Dark Blade on June 20, 2007, 03:40:00 AM
Well, I connected cereal with toys...

From
Quote
nice attention span.. did it come with the cereal?
and
Quote
They are just toys
Title: Re: question on creating a batch file
Post by: reaper_tbs on June 20, 2007, 03:41:00 AM
nice one lojavascript:replaceText(' ;D', document.forms.postmodify.message);
Grinl

oh... that's never shown up before when i've clicked a smiley :|
Title: Re: question on creating a batch file
Post by: Dark Blade on June 20, 2007, 03:52:26 AM
Hmmm, Dudeoxide quoted me once, and it returned Grin, instead of ;D
Title: Re: question on creating a batch file
Post by: reaper_tbs on June 20, 2007, 03:53:09 AM
lol oh well.. minor programming error.. sorta like THE STAR WARS TELEPORTER TOPIC  :-X :-X :-X
Title: Re: question on creating a batch file
Post by: dos nerd on October 13, 2007, 10:59:12 PM
Hi,

I would like to start a different application (say B.exe) automatically when I start one application (say A.exe) ? If I had to write a batch file for doing this, how would I do it? Appreciate your help very much. Thanks in advance.

You would have to check if you already have another batch file. If your computer only allows one you
would have to delete it or only have one.
Title: Re: question on creating a batch file
Post by: contrex on October 14, 2007, 12:36:17 AM
dos nerd, why are you writing a nonsensical meaningless misleading answer to a thread that died 4 months ago?
Title: Re: question on creating a batch file
Post by: contrex on October 14, 2007, 02:21:15 AM
dos nerd, could you please ONLY post when BOTH these things are true:-

a. You understand the question

b. You know the answer

(You're getting noticed.)

Title: Re: question on creating a batch file
Post by: dos nerd on October 16, 2007, 02:40:47 AM
Try to give more information and be a bit mor specific.
If this even is a proper qquestion
Title: Re: question on creating a batch file
Post by: Dark Blade on October 17, 2007, 12:20:51 AM
Try to give more information and be a bit mor specific.
If this even is a proper qquestion

What?... As contrex said...
dos nerd, why are you writing a nonsensical meaningless misleading answer to a thread that died 4 months ago?

Title: Re: question on creating a batch file
Post by: contrex on October 17, 2007, 02:08:39 PM
dos nerd, (Hi everybody from Barcelona!) You are wasting everybody´s time with your nonsense.

Eres pendejo.