How write a simple script file to execute basic commands?

R

rcook349

I'm trying to automate our builds and publishes of our Windows application
(deployed to a website via ClickOnce).

I'm getting close, I think, on the commands I need to execute. However, how
do I put these commands in some sort of executable file?

I thought at first a VBScript file (Windows script), but from what I'm
reading that is old techology.

A script in PowerShell? Not too familiar with this?

A Windows Console Application?

Here are the commands I wish to execute nightly:

***************
msbuild.exe helloworld.vbproj /target:publish
/property:publishurl=http://localhost/helloworlddev
xcopy.exe d:\projects\helloworld\helloworld\bin\debug\app.publish
c:\inetpub\wwwroot\helloworlddev /s

msbuild.exe helloworld.vbproj /target:publish
/property:publishurl=http://localhost/helloworldtest
xcopy.exe d:\projects\helloworld\helloworld\bin\debug\app.publish
c:\inetpub\wwwroot\helloworldtest /s

msbuild.exe helloworld.vbproj /target:publish
/property:publishurl=http://localhost/helloworlduser
xcopy.exe d:\projects\helloworld\helloworld\bin\debug\app.publish
c:\inetpub\wwwroot\helloworlduser /s
***************

If it matters, being in the Visual Studio 2008 Command Prompt is required (I
don't think it can be done from a regular command prompt).

The last time I dealt with anything like this is was creating autoexec.bat
files in DOS 20 years ago!

Thanks.
 
R

rowe_newsgroups

I'm trying to automate our builds and publishes of our Windows application
(deployed to a website via ClickOnce).

I'm getting close, I think, on the commands I need to execute.  However, how
do I put these commands in some sort of executable file?

I thought at first a VBScript file (Windows script), but from what I'm
reading that is old techology.

A script in PowerShell?  Not too familiar with this?

A Windows Console Application?

Here are the commands I wish to execute nightly:

***************
msbuild.exe helloworld.vbproj /target:publish
/property:publishurl=http://localhost/helloworlddev
xcopy.exe d:\projects\helloworld\helloworld\bin\debug\app.publish
c:\inetpub\wwwroot\helloworlddev /s

msbuild.exe helloworld.vbproj /target:publish
/property:publishurl=http://localhost/helloworldtest
xcopy.exe d:\projects\helloworld\helloworld\bin\debug\app.publish
c:\inetpub\wwwroot\helloworldtest /s

msbuild.exe helloworld.vbproj /target:publish
/property:publishurl=http://localhost/helloworlduser
xcopy.exe d:\projects\helloworld\helloworld\bin\debug\app.publish
c:\inetpub\wwwroot\helloworlduser /s
***************

If it matters, being in the Visual Studio 2008 Command Prompt is required(I
don't think it can be done from a regular command prompt).

The last time I dealt with anything like this is was creating autoexec.bat
files in DOS 20 years ago!

Thanks.

You should be able to use System.Diagnostics.Process.Start to execute
those.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top