1.

Solve : How to write a batch command for the following requirement?

Answer»

Hi,

I have to run a program from a location the following is my batch file code

ECHO off
echo Hello this is a test batch file
START D:\ORDSG\instances\instance1\bin>ltctctl.bat startall
pause

basically  I have to run ltctctl.bat program with the syntax as "ltctctl.bat startall" but when I run this batch file it opens the location
D:\ORDSG\instances\instance1\bin which contains the file ltctctl.bat instead of running the command "ltctctl.bat startall".

PLEASE SUGGEST

THANKS ,
Jay
Try this:
Code: [Select]echo off
echo Hello this is a test batch file
START "" D:\ORDSG\instances\instance1\bin\ltctctl.bat startall


Your path statement was incorrect.  You had the prompt instead of the patch.

type start /? from a cmd prompt and more info. Quote from: [email protected] on April 07, 2010, 06:25:06 AM

echo off
echo Hello this is a test batch file
START D:\ORDSG\instances\instance1\bin>ltctctl.bat startall

basically  I have to run ltctctl.bat program with the syntax as "ltctctl.bat startall"
Please suggest



C:\bin>type   ltctctl.bat
Code: [Select]rem C:\bin\ltctctl.bat startall
rem the above REQUIRES a command line argument

echo off
echo Hello this is a test batch file

rem C:\bin\ltctctl.bat %1

echo  ltctctl  %1
Output:

C:\bin>ltctctl.bat  startall

Hello this is a test batch file
 ltctctl  startall

C:\bin>Hi Thanks to all of you ..

I had actualy made a mistake in the command which Mr. Gregflowers rightly pointed.

Thanks,



Discussion

No Comment Found