[skip to the bottom for a better way to do this]
There are a couple of issues with your syntax that you'll need to address.
1) The %variable in a "for" command should be a single letter. That's why you're getting the error that you see. You
can do a quick test of this on a command line with the following incorrect syntax,
for /d %test in (*) do @echo %test
which results in,
%test was unexpected at this time.
To correct this, try
for /d %t in (*) do @echo %t
You should see a listing of directories in the current directory, provided there are directories to list. This leads us to the second part..
2) The "/d" switch plus a wildcard in the (...) section will assume that you're trying to list directories instead of filenames.
So the line (corrected for the variable),
for /d %%m in (D:\MulticlientServer1000\*) do ...
will attempt to run your next commands on directory names that it finds in "D:\MulticlientServer1000\" instead of any individual filenames it finds.
You can demonstrate this by creating a couple empty test directories in "D:\MulticlientServer1000\" then run this command line to list the directories,
for /d %m in (D:\MulticlientServer1000\*) do echo %m
You should see a listing of those subdirectories.
The way that I like to get a clean listing of filenames that may include spaces is like this,
for /f "tokens=*" %i in ('dir /a-d /b') do @echo "%i"
This gets a bare directory listing of all files and uses the "tokens=*" to prevent truncating filenames that contain spaces. You can change the dir command to match the filenames you're looking for, like,
for /f "tokens=*" %i in ('dir d:\MultiServerClient1000\ /a-d /b') do @echo "%i"
3) It looks like you're trying to use the "V1" variable as an incrementer to append to your filenames. The problem I see here is that you have your initial declaration (set v1=1) inside your do loop. You should probably put that at the top of your batch file and outside of your do loop. Then it will start at 1 and increment inside the 'do' with your 'set /a v1=v1+1' command.
However, this brings up another issue - enviroment variable expansion versus delayed environment variable expansion. Basically, without delayed environment variable expansion, you're going to have a hard time getting your increment counter to work properly because of the way that the environment variable is stored and when/how it is read.
You can demonstrate this issue with the following batch file,
@echo off
set v1=1
for /L %%i in (1,1,10) do (
set /a v1=v1+1
@echo %v1%
)
This sets v1=1, then runs through a loop to increment v1 and echo it back to the screen. The problem is that the v1 is echo'ed back during the batch as "1". If you look at your environment variables after you run this batch, then V1=11. So something fishy is going on with how the environment variable is read and displayed during runtime.
You can get around this by enabling delayed environment variable expansion when you invoke a cmd window by calling it with "cmd /v", then using the "!" delimiter during variable expansion, like this,
set v1=1
for /l %%i in (1,1,10) do (
set /a v1=!v1!+1
@echo !v1!
)
and now, the incremented variable is properly displayed during runtime. (Note: make sure to close this window when you're finished testing delayed environment variable expansion - or else you'll introduce issues with variable expansion in any batches you run in this command window later.)
===================
[BETTER WAY]
===================
However, this is getting WAY TOO complicated for what you need to do, in my opinion. Instead of using an environment variable as an incrementer, let's just use a different "for" command ... maybe something like,
for /L %%m in (1,1,1000) do (
@echo ssr 0 MultiServerClient MultiServerClient%%m MultiServerClient%%m.java
)
This uses the "for /L" command/switch to automatically increment the %%m variable. You can use that to call the appropriate mutliserverclient%%m filenames.
In my example I'm just doing a screen echo of an example ssr command so you can see how it might run. For your batch, you would remove the "@echo" that comes before the "ssr" command. And, you would run this in the directory that contains your java files.
Also, Yahoo! Answers wraps long lines. The whole "@echo..." line should be on one line. In fact, now that we've simplified this command, you could put the entire thing on one line either in a batchfile or called from a commandline.
In a batch,
for /l %%m in (1,1,1000) do (@echo ssr 0 MultiServerClient MultiServerClient%%m MultiServerClient%%m.java)
On a commandline,
for /l %m in (1,1,1000) do (@echo ssr 0 MultiServerClient MultiServerClient%m MultiServerClient%m.java)