Knowledge Walls
John Peter
Pune, Maharashtra, India
How to add ms-dos parameters/arguments with spaces
2603 Views
%1 %2 %3 - used to read command line argument inputs on ms dos batch file. But if user inserts spaces inbetween command line arguments then has to use %~1 %~2 %~3.

%1 with example
runit.bat john

%~1 with example
runit.bat "john kumar s"
Example
@echo off
 
echo 1ST Argument: %1
echo 2ND Argument: %~2
echo 3RD Argument: %~3

set /p exit=Press any key to exit
Output 
Previous Topics
Previous lessons of current book.
Logical Operators of MS-DOS Commands
Logical Operators of MS-DOS Commands
Logical Operators of MS-DOS Commands
Relational Operators of MS-DOS Commands
Best Lessons of "MS-DOS Commands"
Top lessons which are viewed more times.
Arithmetic Operators of MS-DOS Commands
Arithmetic Operators of MS-DOS Commands
String manipulation of MS-DOS Commands
String manipulation of MS-DOS Commands
Arithmetic Operators of MS-DOS Commands
Relational Operators of MS-DOS Commands
Logical Operators of MS-DOS Commands
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details