Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - how to execute a batch file with arguments from powershell

Reply
 
Old 09-24-2008   #1 (permalink)
AdityaKir


 
 

how to execute a batch file with arguments from powershell

hi,

I have a particular requirement which dictates that i need to execute the
batch file from powershell Script. Not only this but the script executes and
passes some data to the batch file and then the batch file will execute by
taking the parameters passed to it. All this goes in a loop and the calling
the batch file with arguments is also in the loop.

Thanks,

Aditya

My System SpecsSystem Spec
Old 09-25-2008   #2 (permalink)
Jon


 
 

Re: how to execute a batch file with arguments from powershell

"AdityaKir" <AdityaKir@xxxxxx> wrote in message
news5C38E39-C0D9-4AFE-A8B9-481E4CF98271@xxxxxx
Quote:

> hi,
>
> I have a particular requirement which dictates that i need to execute the
> batch file from powershell Script. Not only this but the script executes
> and
> passes some data to the batch file and then the batch file will execute by
> taking the parameters passed to it. All this goes in a loop and the
> calling
> the batch file with arguments is also in the loop.
>
> Thanks,
>
> Aditya


Here's an example ....

PS (1) > & "C:\temp\a.bat" "hello" "world"
hello
world
PS (2) >

where a.bat contains ....

@echo off
echo %1
echo %2

--
Jon



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Batch file to execute files in subfolders PowerShell
How to execute a batch file on startup? Vista General
Running batch file from Powershell script PowerShell
Call powershell script via Batch-File PowerShell
powershell arguments : PARAM vs ARGS ? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46