Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: question on creating a batch file  (Read 14192 times)

0 Members and 1 Guest are viewing this topic.

floridian2005

  • Guest
question on creating a batch file
« 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.

Carbon Dudeoxide

  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Re: question on creating a batch file
« Reply #1 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)

floridian2005

  • Guest
Re: question on creating a batch file
« Reply #2 on: June 15, 2007, 07:21:23 AM »
yes, exactly

Carbon Dudeoxide

  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Re: question on creating a batch file
« Reply #3 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.

contrex

  • Guest
Re: question on creating a batch file
« Reply #4 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


Carbon Dudeoxide

  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Re: question on creating a batch file
« Reply #5 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.

ghostdog74



    Specialist

    Thanked: 27
    Re: question on creating a batch file
    « Reply #6 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.

    contrex

    • Guest
    Re: question on creating a batch file
    « Reply #7 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?


    contrex

    • Guest
    Re: question on creating a batch file
    « Reply #8 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.


    Carbon Dudeoxide

    • Global Moderator

    • Mastermind
    • Thanked: 169
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Experience: Guru
    • OS: Mac OS
    Re: question on creating a batch file
    « Reply #9 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.

    ghostdog74



      Specialist

      Thanked: 27
      Re: question on creating a batch file
      « Reply #10 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....

      floridian2005

      • Guest
      Re: question on creating a batch file
      « Reply #11 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!

      Carbon Dudeoxide

      • Global Moderator

      • Mastermind
      • Thanked: 169
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Experience: Guru
      • OS: Mac OS
      Re: question on creating a batch file
      « Reply #12 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

      only_lonely



        Intermediate
        Re: question on creating a batch file
        « Reply #13 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?

        Dark Blade

        • Forum Gaming Master


        • Adviser

          Thanked: 24
          • Yes
        • Experience: Experienced
        • OS: Windows XP
        Re: question on creating a batch file
        « Reply #14 on: June 18, 2007, 07:30:24 PM »
        Is it bat2exe, by any chance?

        Carbon Dudeoxide

        • Global Moderator

        • Mastermind
        • Thanked: 169
          • Yes
          • Yes
          • Yes
        • Certifications: List
        • Experience: Guru
        • OS: Mac OS
        Re: question on creating a batch file
        « Reply #15 on: June 18, 2007, 09:32:14 PM »
        bat2exe is outdated...

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

        Click HERE for it.

        Fen_Li



          Beginner

        • G-Smart thing Smart
        • Thanked: 2
          Re: question on creating a batch file
          « Reply #16 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
          ..Still Newbie KID..

          Carbon Dudeoxide

          • Global Moderator

          • Mastermind
          • Thanked: 169
            • Yes
            • Yes
            • Yes
          • Certifications: List
          • Experience: Guru
          • OS: Mac OS
          Re: question on creating a batch file
          « Reply #17 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

          ghostdog74



            Specialist

            Thanked: 27
            Re: question on creating a batch file
            « Reply #18 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.

            contrex

            • Guest
            Re: question on creating a batch file
            « Reply #19 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.

            Dark Blade

            • Forum Gaming Master


            • Adviser

              Thanked: 24
              • Yes
            • Experience: Experienced
            • OS: Windows XP
            Re: question on creating a batch file
            « Reply #20 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?

            ghostdog74



              Specialist

              Thanked: 27
              Re: question on creating a batch file
              « Reply #21 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 ....

              reaper_tbs



                Apprentice

                • Yes
                • Google
              • Certifications: List
              • Computer: Specs
              • Experience: Experienced
              • OS: Other
              Re: question on creating a batch file
              « Reply #22 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...
              Computer Hope

              If I don't reply, I'm probably out returning videotapes.

              Dark Blade

              • Forum Gaming Master


              • Adviser

                Thanked: 24
                • Yes
              • Experience: Experienced
              • OS: Windows XP
              Re: question on creating a batch file
              « Reply #23 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.

              reaper_tbs



                Apprentice

                • Yes
                • Google
              • Certifications: List
              • Computer: Specs
              • Experience: Experienced
              • OS: Other
              Re: question on creating a batch file
              « Reply #24 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 ;)
              Computer Hope

              If I don't reply, I'm probably out returning videotapes.

              Dark Blade

              • Forum Gaming Master


              • Adviser

                Thanked: 24
                • Yes
              • Experience: Experienced
              • OS: Windows XP
              Re: question on creating a batch file
              « Reply #25 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

              reaper_tbs



                Apprentice

                • Yes
                • Google
              • Certifications: List
              • Computer: Specs
              • Experience: Experienced
              • OS: Other
              Re: question on creating a batch file
              « Reply #26 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 :|
              Computer Hope

              If I don't reply, I'm probably out returning videotapes.

              Dark Blade

              • Forum Gaming Master


              • Adviser

                Thanked: 24
                • Yes
              • Experience: Experienced
              • OS: Windows XP
              Re: question on creating a batch file
              « Reply #27 on: June 20, 2007, 03:52:26 AM »
              Hmmm, Dudeoxide quoted me once, and it returned Grin, instead of ;D

              reaper_tbs



                Apprentice

                • Yes
                • Google
              • Certifications: List
              • Computer: Specs
              • Experience: Experienced
              • OS: Other
              Re: question on creating a batch file
              « Reply #28 on: June 20, 2007, 03:53:09 AM »
              lol oh well.. minor programming error.. sorta like THE STAR WARS TELEPORTER TOPIC  :-X :-X :-X
              Computer Hope

              If I don't reply, I'm probably out returning videotapes.

              dos nerd

              • Guest
              Re: question on creating a batch file
              « Reply #29 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.

              contrex

              • Guest
              Re: question on creating a batch file
              « Reply #30 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?

              contrex

              • Guest
              Re: question on creating a batch file
              « Reply #31 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.)


              dos nerd

              • Guest
              Re: question on creating a batch file
              « Reply #32 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

              Dark Blade

              • Forum Gaming Master


              • Adviser

                Thanked: 24
                • Yes
              • Experience: Experienced
              • OS: Windows XP
              Re: question on creating a batch file
              « Reply #33 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?


              contrex

              • Guest
              Re: question on creating a batch file
              « Reply #34 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.


              « Last Edit: October 19, 2007, 10:50:39 AM by contrex »