Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Running a batch file from another?

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 28-02-2008
Linn Kubler
 
Posts: n/a
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



Reply With Quote
  #2  
Old 28-02-2008
Dave R.
 
Posts: n/a
Re: Running a batch file from another?


"Linn Kubler" <lkubler@chartwellwisc2.com> wrote in message
news:u21X13heIHA.5788@TK2MSFTNGP05.phx.gbl...
> 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


Reply With Quote
  #3  
Old 28-02-2008
Linn Kubler
 
Posts: n/a
Re: Running a batch file from another?


"Dave R." <dwragle (at) drbsystems (dot) com> wrote in message
news:ei60OCieIHA.5900@TK2MSFTNGP02.phx.gbl...
>
> "Linn Kubler" <lkubler@chartwellwisc2.com> wrote in message
> news:u21X13heIHA.5788@TK2MSFTNGP05.phx.gbl...
>> 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


Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 07:29 PM.