Wednesday 15 April 2015

vb.net - Execute a program with a parameter from a *.bat file -



vb.net - Execute a program with a parameter from a *.bat file -

i help issue. have vb application located foler:

c:\folder\program.exe

i need execute using *.bat file, need send parameter this:

comprate&--&c:\folder\subfolder\comprate&--&false&--&

when execute application using ide (vs2010) goes case statement (in case 'comprate') , generates file same name folder 'c:\folder\subfolder\'

i have tried in bat file this:

"c:\folder\program.exe" "comprate&--&c:\folder\subfolder\comprate&--&false&--&"

this

"c:\folder\program.exe" comprate&--&c:\folder\subfolder\comprate&--&false&--&

and other options.

escape ampersands ^

& seperates commands on line. && executes command if previous command's errorlevel 0. || (not used above) executes command if previous command's errorlevel not 0 > output file >> append output file < input file | output of 1 command input of command ^ escapes of above, including itself, if needed passed programme " parameters spaces must enclosed in quotes + used re-create concatinate files. e.g. re-create file1+file2 newfile , used re-create indicate missing parameters. updates files modified date. e.g. re-create /b file1,, %variablename% inbuilt or user set environmental variable !variablename! user set environmental variable expanded @ execution time, turned sellocal enabledelayedexpansion command %<number> (%1) nth command line parameter passed batch file. %0 batchfile's name. %* (%*) entire command line. %<a letter> or %%<a letter> (%a or %%a) variable in loop. single % sign @ command prompt , double % sign in batch file. . --

vb.net batch-file windows-7 cmd

No comments:

Post a Comment