Results 1 to 3 of 3

Thread: Running a batch file from another?

  1. #1
    Linn Kubler Guest

    Running a batch file from another?

    Hi,

    I have a batch file setup to install a printer on a remote computer. It
    works fine by itself. But I have a number of computers I want to install
    this printer on so I setup another batch file that simply has a number of
    calls to the first batch file thinking it would simply run down the list but
    it doesn't. It seems to run the first command and then exit. What's the
    trick? Here are my batch files:

    Remote_Install_TPN_Therm_Printer.cmd
    rundll32 printui.dll, PrintUIEntry /ga /n\\cmw-file2\TPN_Thermal_Labels
    /c\\%1

    Install_TPN_Therm.bat
    Remote_Install_TPN_Therm_Printer.cmd chart409 > TPN_Therm_instal.log
    Remote_Install_TPN_Therm_Printer.cmd chart485 >> TPN_Therm_instal.log
    Remote_Install_TPN_Therm_Printer.cmd chart441 >> TPN_Therm_instal.log
    Remote_Install_TPN_Therm_Printer.cmd chart437 >> TPN_Therm_instal.log
    Remote_Install_TPN_Therm_Printer.cmd chart447 >> TPN_Therm_instal.log
    Remote_Install_TPN_Therm_Printer.cmd chart453 >> TPN_Therm_instal.log
    Remote_Install_TPN_Therm_Printer.cmd chart403 >> TPN_Therm_instal.log
    Remote_Install_TPN_Therm_Printer.cmd chart417 >> TPN_Therm_instal.log
    pause

    TPN_Therm_instal.log
    H:\New System Setup\Remote>rundll32 printui.dll, PrintUIEntry /ga
    /n\\cmw-file2\TPN_Thermal_Labels /c\\chart409


    That's all I get in the log file. Is there some command I need to include
    in my Install_TPN_Therm.bat file?

    Thanks in advance,
    Linn



  2. #2
    Dave R. Guest

    Re: Running a batch file from another?


    "Linn Kubler" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > I have a batch file setup to install a printer on a remote computer.
    > It works fine by itself. But I have a number of computers I want to
    > install this printer on so I setup another batch file that simply has
    > a number of calls to the first batch file thinking it would simply run
    > down the list but it doesn't. It seems to run the first command and
    > then exit. What's the trick? Here are my batch files:
    >
    > Remote_Install_TPN_Therm_Printer.cmd
    > rundll32 printui.dll, PrintUIEntry /ga
    > /n\\cmw-file2\TPN_Thermal_Labels /c\\%1
    >
    > Install_TPN_Therm.bat
    > Remote_Install_TPN_Therm_Printer.cmd chart409 > TPN_Therm_instal.log
    > Remote_Install_TPN_Therm_Printer.cmd chart485 >> TPN_Therm_instal.log
    > Remote_Install_TPN_Therm_Printer.cmd chart441 >> TPN_Therm_instal.log
    > Remote_Install_TPN_Therm_Printer.cmd chart437 >> TPN_Therm_instal.log
    > Remote_Install_TPN_Therm_Printer.cmd chart447 >> TPN_Therm_instal.log
    > Remote_Install_TPN_Therm_Printer.cmd chart453 >> TPN_Therm_instal.log
    > Remote_Install_TPN_Therm_Printer.cmd chart403 >> TPN_Therm_instal.log
    > Remote_Install_TPN_Therm_Printer.cmd chart417 >> TPN_Therm_instal.log
    > pause
    >
    > TPN_Therm_instal.log
    > H:\New System Setup\Remote>rundll32 printui.dll, PrintUIEntry /ga
    > /n\\cmw-file2\TPN_Thermal_Labels /c\\chart409
    >
    >
    > That's all I get in the log file. Is there some command I need to
    > include in my Install_TPN_Therm.bat file?
    >


    For control to return to the calling batch file, you have to use CALL
    batchname instead of just batchname.

    Regards,

    Dave



  3. #3
    Linn Kubler Guest

    Re: Running a batch file from another?


    "Dave R." <dwragle (at) drbsystems (dot) com> wrote in message
    news:[email protected]...
    >
    > "Linn Kubler" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi,
    >>
    >> I have a batch file setup to install a printer on a remote computer. It
    >> works fine by itself. But I have a number of computers I want to install
    >> this printer on so I setup another batch file that simply has a number of
    >> calls to the first batch file thinking it would simply run down the list
    >> but it doesn't. It seems to run the first command and then exit.
    >> What's the trick? Here are my batch files:
    >>
    >> Remote_Install_TPN_Therm_Printer.cmd
    >> rundll32 printui.dll, PrintUIEntry /ga /n\\cmw-file2\TPN_Thermal_Labels
    >> /c\\%1
    >>
    >> Install_TPN_Therm.bat
    >> Remote_Install_TPN_Therm_Printer.cmd chart409 > TPN_Therm_instal.log
    >> Remote_Install_TPN_Therm_Printer.cmd chart485 >> TPN_Therm_instal.log
    >> Remote_Install_TPN_Therm_Printer.cmd chart441 >> TPN_Therm_instal.log
    >> Remote_Install_TPN_Therm_Printer.cmd chart437 >> TPN_Therm_instal.log
    >> Remote_Install_TPN_Therm_Printer.cmd chart447 >> TPN_Therm_instal.log
    >> Remote_Install_TPN_Therm_Printer.cmd chart453 >> TPN_Therm_instal.log
    >> Remote_Install_TPN_Therm_Printer.cmd chart403 >> TPN_Therm_instal.log
    >> Remote_Install_TPN_Therm_Printer.cmd chart417 >> TPN_Therm_instal.log
    >> pause
    >>
    >> TPN_Therm_instal.log
    >> H:\New System Setup\Remote>rundll32 printui.dll, PrintUIEntry /ga
    >> /n\\cmw-file2\TPN_Thermal_Labels /c\\chart409
    >>
    >>
    >> That's all I get in the log file. Is there some command I need to
    >> include in my Install_TPN_Therm.bat file?
    >>

    >
    > For control to return to the calling batch file, you have to use CALL
    > batchname instead of just batchname.
    >
    > Regards,
    >
    > Dave


    Thanks for the prompt response Dave, I figured it was something easy I've
    just not tried that before.

    Thanks,
    Linn



Similar Threads

  1. Running Powershell script with batch file with parameters?
    By Jaslein in forum Software Development
    Replies: 3
    Last Post: 12-01-2011, 03:36 AM
  2. Shutdown window after running batch file
    By Jaiwanti in forum Operating Systems
    Replies: 4
    Last Post: 13-12-2010, 06:25 PM
  3. VBscript to run batch file carry on running
    By hokaday in forum Software Development
    Replies: 1
    Last Post: 12-02-2010, 01:34 AM
  4. Problems running batch file as scheduled task
    By pete0085 in forum Windows Server Help
    Replies: 7
    Last Post: 01-01-2009, 03:15 PM
  5. Windows scheduler: Running a batch file as another user?
    By Andrew Hodgson in forum Windows Server Help
    Replies: 9
    Last Post: 10-03-2008, 09:48 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,864,663.66678 seconds with 16 queries