doubt regarding executing or writing a batch file globally for all modules.

View: New views
9 Messages — Rating Filter:   Alert me  

doubt regarding executing or writing a batch file globally for all modules.

by muthamilans :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi friend's,
  I am trying to automate a simple batch file command

line 1: cd cap
line 2: move ..\input\*_cap.inc ..\cap
line 3: %scad_path%\scad3 -b *_cap.inc

in line 2 is moving a file "name_cap.inc" from input folder to cap
folder.

in line 3 i try to simulate the file that i have moved ... and trying
to execute that file with an exe in an invisible mode but it giving
an error msg that "*_cap.inc contains invalid path".
  if i give the full file name its works.

  i am trying to automate and trying to set the batch file code to
all the modules.

could suggest me in getting the *_cap.inc (name_cap.inc) and running
it with the exe.

Thanks & regds
Muthamil


Re: doubt regarding executing or writing a batch file globally for all modules.

by Parag P. Doke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi.
Maybe the scad3 application/executable does not work with wildcards.
If that is the case, try:
for /f "delims=" %%i in ('dir /b *_cap.in') do start "" /wait
"%scad_path%\scad3" -b %%i

Regards,
Parag P. Doke


On Feb 18, 2008 2:38 PM, muthamilans <muthamilans@...> wrote:

>
>
>
>
>
>
> Hi friend's,
>  I am trying to automate a simple batch file command
>
>  line 1: cd cap
>  line 2: move ..\input\*_cap.inc ..\cap
>  line 3: %scad_path%\scad3 -b *_cap.inc
>
>  in line 2 is moving a file "name_cap.inc" from input folder to cap
>  folder.
>
>  in line 3 i try to simulate the file that i have moved ... and trying
>  to execute that file with an exe in an invisible mode but it giving
>  an error msg that "*_cap.inc contains invalid path".
>  if i give the full file name its works.
>
>  i am trying to automate and trying to set the batch file code to
>  all the modules.
>
>  could suggest me in getting the *_cap.inc (name_cap.inc) and running
>  it with the exe.
>
>  Thanks & regds
>  Muthamil
>
>  



--
Parag P. Doke
http://paragpdoke.blogspot.com

Re: doubt regarding executing or writing a batch file globally for all modules.

by muthamilans :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Parag P. Doke
  I just need to store the "name_cap.inc" from the folder cap and
have to display the name full name right there near

line 3: %scad_path%\scad3 -b name_cap.inc (insted of *_cap.inc)

  how to get the name store the fullname of the file *_cap.inc in
that folder cap folder.

  Actually if i put the full name right there near "scad3 -b" its
working.
 
Thanks & regds
Muthamil


> >
> >
> >
> >
> >
> >
> > Hi friend's,
> >  I am trying to automate a simple batch file command
> >
> >  line 1: cd cap
> >  line 2: move ..\input\*_cap.inc ..\cap
> >  line 3: %scad_path%\scad3 -b *_cap.inc
> >
> >  in line 2 is moving a file "name_cap.inc" from input folder to
cap
> >  folder.
> >
> >  in line 3 i try to simulate the file that i have moved ... and
trying
> >  to execute that file with an exe in an invisible mode but it
giving
> >  an error msg that "*_cap.inc contains invalid path".
> >  if i give the full file name its works.
> >
> >  i am trying to automate and trying to set the batch file code to
> >  all the modules.
> >
> >  could suggest me in getting the *_cap.inc (name_cap.inc) and
running

> >  it with the exe.
> >
> >  Thanks & regds
> >  Muthamil
> >
> >  
>
>
>
> --
> Parag P. Doke
> http://paragpdoke.blogspot.com
>



Re: doubt regarding executing or writing a batch file globally for all modules.

by foxidrive-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 18 Feb 2008 10:18:01 -0000, "muthamilans" <muthamilans@...>
wrote:

>Dear Parag P. Doke
>  I just need to store the "name_cap.inc" from the folder cap and
>have to display the name full name right there near
>
>line 3: %scad_path%\scad3 -b name_cap.inc (insted of *_cap.inc)
>
>  how to get the name store the fullname of the file *_cap.inc in
>that folder cap folder.
>
>  Actually if i put the full name right there near "scad3 -b" its
>working.

Untested, based upon Parag's code:

@echo off
pushd "..\cap"
for /f "delims=" %%a in ('dir /b *_cap.inc') do (
start "" /wait "%scad_path%\scad3" -b "%%a")
popd



Re: doubt regarding executing or writing a batch file globally for all modules.

by muthamilans :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi friend,
    Thanks friend the code,it is working fine .But i am not able to
understand its working.
    The file is executing well at the same time i am getting that
error command also.
    i asking this since i have to configure this batch file in more
than 100 modules, at the same time i have to convert it to shell
command in linux.

thanks & Regds
Muthamil  

--- In batchworld@..., foxidrive <foxidrive@...> wrote:

>
> On Mon, 18 Feb 2008 10:18:01 -0000, "muthamilans" <muthamilans@...>
> wrote:
>
> >Dear Parag P. Doke
> >  I just need to store the "name_cap.inc" from the folder cap and
> >have to display the name full name right there near
> >
> >line 3: %scad_path%\scad3 -b name_cap.inc (insted of *_cap.inc)
> >
> >  how to get the name store the fullname of the file *_cap.inc in
> >that folder cap folder.
> >
> >  Actually if i put the full name right there near "scad3 -b" its
> >working.
>
> Untested, based upon Parag's code:
>
> @echo off
> pushd "..\cap"
> for /f "delims=" %%a in ('dir /b *_cap.inc') do (
> start "" /wait "%scad_path%\scad3" -b "%%a")
> popd
>



Re: doubt regarding executing or writing a batch file globally for all modules.

by foxidrive-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 18 Feb 2008 11:15:56 -0000, "muthamilans" <muthamilans@...>
wrote:

>    Thanks friend the code,it is working fine .But i am not able to
>understand its working.
>    The file is executing well at the same time i am getting that
>error command also.

Which error message?

>    i asking this since i have to configure this batch file in more
>than 100 modules, at the same time i have to convert it to shell
>command in linux.

>> @echo off
>> pushd "..\cap"

The line above makes the current directory the ..\cap folder

>> for /f "delims=" %%a in ('dir /b *_cap.inc') do (
>> start "" /wait "%scad_path%\scad3" -b "%%a")

The line above creates a list from the output of the command "dir /b *_cap.inc"
Execute that command at the prompt in the correct folder to see what the list
looks like.

It then executes your "scad3 -b %%a" command and for every line of the list it
replaces %%a with the line.

The start command is used here but may not be necessary - try omitting the
start "" /wait portion.  If scad3 is a multithreaded command then it would try
to execute the commands at the same time, which is when the start command is
useful.

>> popd

Popd returns you to the folder you started in.



Re: doubt regarding executing or writing a batch file globally for all modules.

by muthamilans :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Friend,
   Thanks for your explanation. i am able to understand clearly now.
And the Error Message coming while executing is "*_cap.inc contains a
invalid path".

Can able to remove the error message.

Thanks & Regds
Muthamil

--- In batchworld@..., foxidrive <foxidrive@...> wrote:
>
> On Mon, 18 Feb 2008 11:15:56 -0000, "muthamilans" <muthamilans@...>
> wrote:
>
> >    Thanks friend the code,it is working fine .But i am not able
to
> >understand its working.
> >    The file is executing well at the same time i am getting that
> >error command also.
>
> Which error message?
>
> >    i asking this since i have to configure this batch file in
more

> >than 100 modules, at the same time i have to convert it to shell
> >command in linux.
>
> >> @echo off
> >> pushd "..\cap"
>
> The line above makes the current directory the ..\cap folder
>
> >> for /f "delims=" %%a in ('dir /b *_cap.inc') do (
> >> start "" /wait "%scad_path%\scad3" -b "%%a")
>
> The line above creates a list from the output of the
command "dir /b *_cap.inc"
> Execute that command at the prompt in the correct folder to see
what the list
> looks like.
>
> It then executes your "scad3 -b %%a" command and for every line of
the list it
> replaces %%a with the line.
>
> The start command is used here but may not be necessary - try
omitting the
> start "" /wait portion.  If scad3 is a multithreaded command then
it would try
> to execute the commands at the same time, which is when the start
command is
> useful.
>
> >> popd
>
> Popd returns you to the folder you started in.
>



Re: doubt regarding executing or writing a batch file globally for all modules.

by foxidrive-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 19 Feb 2008 09:48:46 -0000, "muthamilans" <muthamilans@...>
wrote:

>   Thanks for your explanation. i am able to understand clearly now.
>And the Error Message coming while executing is "*_cap.inc contains a
>invalid path".
>
>Can able to remove the error message.

I can't see where that error would creep in muthamilans.



Re: doubt regarding executing or writing a batch file globally for all modules.

by muthamilans :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi friend,
  Thanks soo much for your kind response foxidrive, i will correct it.

Thanks & regds
Muthamil

--- In batchworld@..., foxidrive <foxidrive@...> wrote:
>
> On Tue, 19 Feb 2008 09:48:46 -0000, "muthamilans" <muthamilans@...>
> wrote:
>
> >   Thanks for your explanation. i am able to understand clearly
now.
> >And the Error Message coming while executing is "*_cap.inc
contains a
> >invalid path".
> >
> >Can able to remove the error message.
>
> I can't see where that error would creep in muthamilans.
>