Batch file which should execute the commands

February 10, 2011 at 07:06:32
Specs: Windows XP
Hi All,

I need a batchfile with following functionality,

1) Go to "D:\Abc\test\server\bin"
2) Run the following commands and redirect the output to a log file

pmrep connect
pmcmd get

3) Sleep for 1 min and then after each minute it should run the above commands again

thanks in advance



See More: Batch file which should execute the commands

Report •

#1
February 10, 2011 at 13:49:01
try this..

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@echo off
wscript.echo 60000 >%temp%\1.vbs
:Star
cd /d "D:\Abc\test\server\bin"
pmrep connect >>logfile.txt
pmcmd get >>logfile.txt
wscript.echo 60000 >%temp%\1.vbs
goto :Star

++++++++++++++++++++++++++++++++++++++++

Subhash Chandra.
www.s-chandra.co.cc


Report •

#2
February 11, 2011 at 05:45:05
Hi Subhash,

its not working. its showing wscript.echo is not valid command. I need it for windows.


Report •

#3
February 12, 2011 at 08:06:08
Just add echo before wscript. the new file would be like this .. 2 line changed.


@echo off
echo wscript.echo 60000 >%temp%\1.vbs
:Star
cd /d "D:\Abc\test\server\bin"
pmrep connect >>logfile.txt
pmcmd get >>logfile.txt
cscri[t /nologo temp%\1.vbs
goto :Star

Subhash Chandra.
www.s-chandra.co.cc


Report •

Related Solutions

#4
February 12, 2011 at 10:12:50
@echo off
echo wscript.echo 60000 >%temp%\1.vbs
:Star
cd /d "D:\Abc\test\server\bin"
pmrep connect >>logfile.txt
pmcmd get >>logfile.txt
cscript /nologo %temp%\1.vbs
goto :Star

Happy is ONE who says I am an OttoMAN.


Report •

#5
February 12, 2011 at 11:14:30
oh Thanks Mu. I missed % .

Subhash Chandra.
www.s-chandra.co.cc


Report •

#6
February 12, 2011 at 13:57:56
and the 'p' from cscript ;)

Happy is ONE who says I am an OttoMAN.


Report •

#7
February 13, 2011 at 00:56:55
Hi guys,

its not automatically running the commands after each 60 seconds. only if i hit enter key then only it ll run the command again. i want it to be running automatically after each 60 seconds


Report •

#8
February 13, 2011 at 02:14:53
hi sorry .. its running the commands continuosly.. its not giving pause for 1 minute also.. wat is 60000 in ur batch file stands for

Report •

#9
February 13, 2011 at 13:15:59
hi.. Really sorry. I was in rush whening replying this post everytime.


@echo off
echo wscript.sleep 60000 >%temp%\1.vbs
:Star
cd /d "D:\Abc\test\server\bin"
pmrep connect >>logfile.txt
pmcmd get >>logfile.txt
cscript /nologo %temp%\1.vbs
goto :Star


Please replace wscript.echo to wscript.sleep as above mentioned.
the numiric value is milisecound value to wait for.

Subhash Chandra.
www.s-chandra.co.cc


Report •

Ask Question