PC Review


Reply
Thread Tools Rate Thread

How create batch file using Windows SDK Command Prompt?

 
 
Ronald S. Cook
Guest
Posts: n/a
 
      10th Apr 2007
Currently (manually), I 1) open a Windows SDK Command Prompt and 2) navigate
to a particular folder. Then I 3) type a command and press enter. The
command is irrelevant (WCF-related) but here it is FYI:

svcutil http://localhost/COWFeedyardService/Services/Pen.svc /out:Pen.vb
/config:App.config /language:VB

All works fine, but I need to do this over a hundred times changing "Pen" to
the names of the other classes and re-executing.

QUESTION: How can I create a batch file that I can list all the lines in and
have it run them under the Windows SDK Command Prompt?

svcutil http://localhost/COWFeedyardService/Services/Pen.svc /out:Pen.vb
/config:App.config /language:VB
svcutil http://localhost/COWFeedyardService/Services/Lot.svc /out:Lot.vb
/config:App.config /language:VB
svcutil http://localhost/COWFeedyardService/Services/Animal.svc
/out:Animal.vb /config:App.config /language:VB
etc...

Thanks,
Ron



 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      10th Apr 2007
Ronald,

You don't need to have it run under the Windows SDK Command Prompt. Why
not just include the full path to svcutil? That's really all you need.
That, and you need to specify a full path for the out and config parameters
as well, but that's a simple task.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Ronald S. Cook" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Currently (manually), I 1) open a Windows SDK Command Prompt and 2)
> navigate to a particular folder. Then I 3) type a command and press
> enter. The command is irrelevant (WCF-related) but here it is FYI:
>
> svcutil http://localhost/COWFeedyardService/Services/Pen.svc /out:Pen.vb
> /config:App.config /language:VB
>
> All works fine, but I need to do this over a hundred times changing "Pen"
> to the names of the other classes and re-executing.
>
> QUESTION: How can I create a batch file that I can list all the lines in
> and have it run them under the Windows SDK Command Prompt?
>
> svcutil http://localhost/COWFeedyardService/Services/Pen.svc /out:Pen.vb
> /config:App.config /language:VB
> svcutil http://localhost/COWFeedyardService/Services/Lot.svc /out:Lot.vb
> /config:App.config /language:VB
> svcutil http://localhost/COWFeedyardService/Services/Animal.svc
> /out:Animal.vb /config:App.config /language:VB
> etc...
>
> Thanks,
> Ron
>
>
>



 
Reply With Quote
 
John Vottero
Guest
Posts: n/a
 
      10th Apr 2007
"Ronald S. Cook" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Currently (manually), I 1) open a Windows SDK Command Prompt and 2)
> navigate to a particular folder. Then I 3) type a command and press
> enter. The command is irrelevant (WCF-related) but here it is FYI:
>
> svcutil http://localhost/COWFeedyardService/Services/Pen.svc /out:Pen.vb
> /config:App.config /language:VB
>
> All works fine, but I need to do this over a hundred times changing "Pen"
> to the names of the other classes and re-executing.
>
> QUESTION: How can I create a batch file that I can list all the lines in
> and have it run them under the Windows SDK Command Prompt?


Call SDKVARS.BAT from your batch file.

You can right click the "Windows SDK Command Prompt" shortcut to see what
it's really doing, look at the target.




 
Reply With Quote
 
Ronald S. Cook
Guest
Posts: n/a
 
      10th Apr 2007
So would you guys create the batch file in Notepad or something? I keep
hearing about "PowerShell" but not sure how to work with that.

Thanks for any ideas.


"John Vottero" <(E-Mail Removed)> wrote in message
news:E25F827B-75E3-4C98-BB3A-(E-Mail Removed)...
> "Ronald S. Cook" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Currently (manually), I 1) open a Windows SDK Command Prompt and 2)
>> navigate to a particular folder. Then I 3) type a command and press
>> enter. The command is irrelevant (WCF-related) but here it is FYI:
>>
>> svcutil http://localhost/COWFeedyardService/Services/Pen.svc /out:Pen.vb
>> /config:App.config /language:VB
>>
>> All works fine, but I need to do this over a hundred times changing "Pen"
>> to the names of the other classes and re-executing.
>>
>> QUESTION: How can I create a batch file that I can list all the lines in
>> and have it run them under the Windows SDK Command Prompt?

>
> Call SDKVARS.BAT from your batch file.
>
> You can right click the "Windows SDK Command Prompt" shortcut to see what
> it's really doing, look at the target.
>
>
>
>



 
Reply With Quote
 
John Vottero
Guest
Posts: n/a
 
      11th Apr 2007
"Ronald S. Cook" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> So would you guys create the batch file in Notepad or something? I keep
> hearing about "PowerShell" but not sure how to work with that.
>


PowerShell is MUCH better than batch scripts. It sounds like you're new to
batch scripts and PowerShell, if so, your time would be better spent
learning PowerShell.

You can use Notepad or any other text editor to create a PowerSell script.
You could also use one of these PowerShell specific editors:

http://www.powershellanalyzer.com

http://www.powershell.com

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The simple way to disable/enable LAN from command prompt, with a batch file, using devcon.exe setup21@gmx.de Microsoft Windows 2000 Networking 4 22nd Jul 2008 08:52 PM
Command prompt / batch file equivalent of UNIX '&' MS Microsoft Windows 2000 CMD Promt 6 12th May 2006 05:27 PM
Microsoft Access 2000 and Batch file / Command Prompt =?Utf-8?B?SGF0czY2Ng==?= Microsoft Access 0 12th May 2005 07:58 PM
How to create a prompt for user input in a batch file? Anthony Microsoft Windows 2000 CMD Promt 2 24th Oct 2003 02:18 PM
hide command prompt window when running batch file ? scott Microsoft Windows 2000 3 19th Sep 2003 12:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:07 PM.