Welcome to EMC Consulting Blogs Sign in | Join | Help

Merrick Chaffer's Blog

How to trim characters from the path in DOS Batch programming

A colleague of mine Paul Taylor (http://paul-taylor.co.uk/blog/) recently figured out how to do this.

Here's an example that will spin up the Visual studio cassini web host for your project, assuming you place this batch file in the folder the web project sits in.

@echo off

set currentPath=%~dp0
if "%currentPath:~-1%"=="\" SET currentPath=%currentPath:~0,-1%

start WebDev.WebServer.EXE /port:62036 /path:"%currentPath%" /vpath:"/"

start iexplore.exe http://localhost:62036/default.aspx

Published 08 December 2009 12:27 by merrick.chaffer
Filed under: ,

Comments

No Comments
Anonymous comments are disabled

This Blog

Syndication

News

Powered by Community Server (Personal Edition), by Telligent Systems