Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Batch file: how to get all remaining parameters after a SH..

 
   Windows (Home) -> General Discussion RSS
Next:  Need to locate a computer  
Author Message
Ronald Fischer

External


Since: Jul 17, 2006
Posts: 4



(Msg. 1) Posted: Thu Aug 09, 2007 2:25 pm
Post subject: Batch file: how to get all remaining parameters after a SHIFT
Archived from groups: microsoft>public>windowsxp>general (more info?)

My Batch-File is supposed to work like this:

Invocation (variable parameter list):

MYBATCH.CMD FOO BAR P1 P2 P3....

Execution

(1) Execute MYBATCH_HELPER.CMD FOO
(2) Execute BAR P1 P2 P3 ....

How do I write this batch program? My first attempt went like this:

REM This MYBATCH.CMD does not work
MYBATCH_HELPER.CMD %1
SHIFT /1
%*

But this does not work, because %* always gets substituted by all
original parameters, ignoring the effect of any previous SHIFT.
Of course I could write it like this:

REM This MYBATCH.CMD works halfways
MYBATCH_HELPER.CMD %1
SHIFT /1
%1 %2 %3 %4 %5 %6 %7 %8 %9

But this is not really a variable parameter list, because there
can only be actual parameters P1 ... P8.

Any better solution to this?

Ronald


--
Ronald Fischer <ronaldf DeleteThis @eml.cc>
Posted via http://www.newsoffice.de/
Back to top
Login to vote
ToddAndMargo

External


Since: Jul 18, 2007
Posts: 24



(Msg. 2) Posted: Thu Aug 09, 2007 2:25 pm
Post subject: Re: Batch file: how to get all remaining parameters after a SHIFT [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ronald Fischer wrote:
> My Batch-File is supposed to work like this:
>
> Invocation (variable parameter list):
>
> MYBATCH.CMD FOO BAR P1 P2 P3....
>
> Execution
>
> (1) Execute MYBATCH_HELPER.CMD FOO
> (2) Execute BAR P1 P2 P3 ....
>
> How do I write this batch program? My first attempt went like this:
>
> REM This MYBATCH.CMD does not work
> MYBATCH_HELPER.CMD %1
> SHIFT /1
> %*
>
> But this does not work, because %* always gets substituted by all
> original parameters, ignoring the effect of any previous SHIFT.
> Of course I could write it like this:
>
> REM This MYBATCH.CMD works halfways
> MYBATCH_HELPER.CMD %1
> SHIFT /1
> %1 %2 %3 %4 %5 %6 %7 %8 %9
>
> But this is not really a variable parameter list, because there
> can only be actual parameters P1 ... P8.
>
> Any better solution to this?
>
> Ronald
>

I actually do not know the answer, but there is a really
great batch newsgroup that you can ask this question of.
I have great success with them:

alt.msdos.batch

HTH,
-T
Back to top
Login to vote
Paul Randall

External


Since: Aug 09, 2007
Posts: 26



(Msg. 3) Posted: Thu Aug 09, 2007 3:15 pm
Post subject: Re: Batch file: how to get all remaining parameters after a SHIFT [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I can't help you with batch files.
Have you used WXP's built-in command line reference a-z? There is an entry
for batch files which explains all the batch file commands with some
examples, including one for the use of the shift parameter.

-Paul Randall

"Ronald Fischer" <ronaldf.RemoveThis@eml.cc> wrote in message
news:1186662348.14@user.newsoffice.de...
> My Batch-File is supposed to work like this:
>
> Invocation (variable parameter list):
>
> MYBATCH.CMD FOO BAR P1 P2 P3....
>
> Execution
>
> (1) Execute MYBATCH_HELPER.CMD FOO
> (2) Execute BAR P1 P2 P3 ....
>
> How do I write this batch program? My first attempt went like this:
>
> REM This MYBATCH.CMD does not work
> MYBATCH_HELPER.CMD %1
> SHIFT /1
> %*
>
> But this does not work, because %* always gets substituted by all
> original parameters, ignoring the effect of any previous SHIFT.
> Of course I could write it like this:
>
> REM This MYBATCH.CMD works halfways
> MYBATCH_HELPER.CMD %1
> SHIFT /1
> %1 %2 %3 %4 %5 %6 %7 %8 %9
>
> But this is not really a variable parameter list, because there
> can only be actual parameters P1 ... P8.
>
> Any better solution to this?
>
> Ronald
>
>
> --
> Ronald Fischer <ronaldf.RemoveThis@eml.cc>
> Posted via http://www.newsoffice.de/
>
Back to top
Login to vote
Ronny

External


Since: Aug 10, 2007
Posts: 1



(Msg. 4) Posted: Fri Aug 10, 2007 2:05 am
Post subject: Re: Batch file: how to get all remaining parameters after a SHIFT [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 9 Aug., 23:15, "Paul Randall" <paulr... RemoveThis @cableone.net> wrote:
> I can't help you with batch files.
> Have you used WXP's built-in command line reference a-z? There is an entry
> for batch files which explains all the batch file commands with some
> examples, including one for the use of the shift parameter.

I guess you mean

HELP SHIFT

??? But this does not say anything which would solve my problem.... As
you can
see from the code I have posted, I *do* use shift after all...

Ronald
Back to top
Login to vote
"Pegasus

External


Since: Apr 28, 2005
Posts: 138



(Msg. 5) Posted: Fri Aug 10, 2007 12:22 pm
Post subject: Re: Batch file: how to get all remaining parameters after a SHIFT [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Ronny" <ro.naldfi.scher.DeleteThis@gmail.com> wrote in message
news:1186736722.061536.310300@x35g2000prf.googlegroups.com...
> On 9 Aug., 23:15, "Paul Randall" <paulr....DeleteThis@cableone.net> wrote:
>> I can't help you with batch files.
>> Have you used WXP's built-in command line reference a-z? There is an
>> entry
>> for batch files which explains all the batch file commands with some
>> examples, including one for the use of the shift parameter.
>
> I guess you mean
>
> HELP SHIFT
>
> ??? But this does not say anything which would solve my problem.... As
> you can
> see from the code I have posted, I *do* use shift after all...
>
> Ronald

I've been following this thread with a degree of curiosity. I thought
that Todd's reply was spot on but so far I haven't noticed your
repost in the newsgroup he suggested. Paul's reply was, of course,
mildly amusing. Be it as it is, I confess that I do not fully understand
what you're trying to achieve. I agree that the shift command won't
have any effect on %* but I don't know what the purpose of the
whole exercise is. Perhaps a rephrase with an actual example might
lift the fog off my brain.
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Batch file to start multiple programs at once, without del.. - I want a batch file to launch a few programs all at the same time. But, the batch file waits until each program terminates before continuing onto the next line. Can I made it not wait? thanks, Zytan

Batch Delete Help - I am trying to find a batch command that takes a directory and deletes all files in that directory, along with subdirectories, leaving an empty top level folder. For instance I have a directory C:\test. In C:\test there are 5 .txt files and another..

application file - Folks: During the installation of the typical windows application; the files associated with that application have to be first EXTRACTED before they can be installed. I have such the file. It is NOT a zip file. * Can I get ACCESS (view, copy,..

Corrupt or Missing file - I restored my computer to an earlier date and it appeared as if everything restored fine. After shutting down system and then trying to restart I got following msg..."Windows could not start because yhje following file was missing or corrupt &lt...

Using Windows XP Pro as File Server - Losing Connections - A small office is using a new Win XP Pro machine as a file server for 5 computers. Somehow, every week or so, people are losing connections with the server. One or more of the workstations are not releasing one of the 10 available licenses. I have set...
       Windows (Home) -> General Discussion All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
  Windows Forums
 Game Forums
 Linux Forums
 Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact