Skip to main content
edited body
Source Link
John Smith
  • 7.4k
  • 7
  • 52
  • 63

Another useful tip is to use %* to mean "all". For example:

echo off
set arg1=%1
set arg2=%2
shift
shift
fake-command /u %arg1% /p %arg2% %*

When you run:

test-command admin password foo bar

theThe above batch file will run:

fake-command /u admin /p password admin password foo bar

I may have the syntax slightly wrong, but this is the general idea.

Another useful tip is to use %* to mean "all". For example:

echo off
set arg1=%1
set arg2=%2
shift
shift
fake-command /u %arg1% /p %arg2% %*

When you run:

test-command admin password foo bar

the above batch file will run:

fake-command /u admin /p password admin password foo bar

I may have the syntax slightly wrong, but this is the general idea.

Another useful tip is to use %* to mean "all". For example:

echo off
set arg1=%1
set arg2=%2
shift
shift
fake-command /u %arg1% /p %arg2% %*

When you run:

test-command admin password foo bar

The above batch file will run:

fake-command /u admin /p password admin password foo bar

I may have the syntax slightly wrong, but this is the general idea.

corrected result
Source Link
Huseyin Yagli
  • 10.4k
  • 7
  • 46
  • 52

Another useful tip is to use %* to mean "all". For example:

echo off
set arg1=%1
set arg2=%2
shift
shift
fake-command /u %arg1% /p %arg2% %*

When you run:

test-command admin password foo bar

the above batch file will run:

fake-command /u admin /p password admin password foo bar

I may have the syntax slightly wrong, but this is the general idea.

Another useful tip is to use %* to mean "all". For example:

echo off
set arg1=%1
set arg2=%2
shift
shift
fake-command /u %arg1% /p %arg2% %*

When you run:

test-command admin password foo bar

the above batch file will run:

fake-command /u admin /p password foo bar

I may have the syntax slightly wrong, but this is the general idea.

Another useful tip is to use %* to mean "all". For example:

echo off
set arg1=%1
set arg2=%2
shift
shift
fake-command /u %arg1% /p %arg2% %*

When you run:

test-command admin password foo bar

the above batch file will run:

fake-command /u admin /p password admin password foo bar

I may have the syntax slightly wrong, but this is the general idea.

Fixed formatting.
Source Link

Another useful tip is to use %*%* to mean "all". For example,:

echo off
set arg1=%1
set arg2=%2
shift
shift
fake-command /u %arg1% /p %arg2% %*

When you run:

test-command admin password foo bar

the above batch file will run:

fake-command /u admin /p password foo bar

I may have the syntax slightly wrong, but this is the general idea.

Another useful tip is to use %* to mean "all". For example,

echo off
set arg1=%1
set arg2=%2
shift
shift
fake-command /u %arg1% /p %arg2% %*

When you run:

test-command admin password foo bar

the above batch file will run:

fake-command /u admin /p password foo bar

I may have the syntax slightly wrong, but this is the general idea.

Another useful tip is to use %* to mean "all". For example:

echo off
set arg1=%1
set arg2=%2
shift
shift
fake-command /u %arg1% /p %arg2% %*

When you run:

test-command admin password foo bar

the above batch file will run:

fake-command /u admin /p password foo bar

I may have the syntax slightly wrong, but this is the general idea.

deleted 14 characters in body
Source Link
Greg Hewgill
  • 1.0m
  • 192
  • 1.2k
  • 1.3k
Loading
made the "updated" solution the only solution -- why include a typo/mistake?
Source Link
Hack-R
  • 23.5k
  • 15
  • 82
  • 138
Loading
add note about shift
Source Link
Greg Hewgill
  • 1.0m
  • 192
  • 1.2k
  • 1.3k
Loading
Source Link
Greg Hewgill
  • 1.0m
  • 192
  • 1.2k
  • 1.3k
Loading