Forum Moderators: phranque

Message Too Old, No Replies

Running batch file in Background

Want to run a batch file in background through schedule task

         

tpraveen

6:33 am on Jun 7, 2005 (gmt 0)

10+ Year Member



HI,
I am trying to run a batch file through schedule task,this batch file internally calls a perl script file, which pop's up a dos window showing output of the perl script.I don't want to see this output,i mean i want ot hide this dos window while schedule taks execute my batch file.
Any suggestion?

bill

9:05 am on Jun 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld tpraveen.

I'm not sure you can do that. You can set

cls
commands in your batch file to clear out the contents of the Command window, but that doesn't do anything to control the window itself. I don't think there are any commands in DOS that will work for this.

Jon_King

1:24 pm on Jun 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe a redirect: >NULL Or a pipe: ¦NULL

tpraveen

1:44 pm on Jun 7, 2005 (gmt 0)

10+ Year Member



Hi Jon_King
Actually problem is, when i am calling the perl script directly, i want to see the dos window displaying output of perl script, but i don't want to see this dos window when schedule task executing the batch file which is internally calling this perl script.

Can you please explain in brief how can i redirect or pipe?

Jon_King

2:25 pm on Jun 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



At the end of your command line in Task Manager try adding ">NULL" (no quotes). Or add it to the end of the batch file line executing your script. The redirect char is to redirect normal output going to the monitor somewhere else... in this case we're sending it to NULL which should keep it from displaying. Won't take much to try it...

tpraveen

2:39 pm on Jun 7, 2005 (gmt 0)

10+ Year Member



Hi Jon_King
Redirection of the output only suppressing the output text but still dos window is coming up.
Any suggestion to hide the dos window?

Jon_King

3:01 pm on Jun 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One more try in Perl, a command to hide dos window:

use Win32::GUI;my $DOS = Win32::GUI::GetPerlWindow();Win32::GUI::Hide($DOS);

tpraveen

12:35 pm on Jun 8, 2005 (gmt 0)

10+ Year Member



HI
The problem got solve.
Thanks.

bill

7:44 am on Jun 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



did the Perl command solve your problem?

tpraveen

7:49 am on Jun 9, 2005 (gmt 0)

10+ Year Member



No,rediretion of output solved the problem

bill

8:45 am on Jun 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In msg #:6 you say:

Redirection of the output only suppressing the output text but still dos window is coming up.
Any suggestion to hide the dos window?

What redirection command were you successfully able to use to hide the DOS window?

tpraveen

9:27 am on Jun 9, 2005 (gmt 0)

10+ Year Member



No dos window is still coming up,redirection only suppressing output text.