Home > Blockchain >  How to pass command line parameters in Visual Studio with a batch file
How to pass command line parameters in Visual Studio with a batch file

Time:01-16

I would like to pass parameters to visual studio with a script where I can enter parameters to the execution

Prompt Par: Par1: ect...

CodePudding user response:

Create this bat file and put it in your project folder you can do it with any kind of scripts

@echo off
setlocal
set /p "_myvar=Par?"
set /p "_myvar1=Par1?"
set /p "_myvar4=Par4"
set /p "_myvar8=Par8"
set /p "_myvar10="Par10"
(
echo ^<?xml version="1.0" encoding="utf-8"?^>
echo ^<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^>
echo ^<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"^>
echo ^<StartArguments^>Admin . %_myvar4% Bus%_myvar%^</StartArguments^>
echo ^</PropertyGroup^>^<PropertyGroup^>
echo ^<ProjectView^>ProjectFiles^</ProjectView^>
echo ^</PropertyGroup^>^</Project^>
)>ProjectName.vbproj.user

  • Related