Article View: comp.os.msdos.programmer
Article #3658Re: Batch problem
From: Joe Trott
Date: Fri, 13 Nov 1992 18:03
Date: Fri, 13 Nov 1992 18:03
32 lines
1357 bytes
1357 bytes
au240@cleveland.Freenet.Edu (Ari Pitkanen) writes:
>How do I pass '%%f' to 'DoIt'? This approach don't work.
>---
>:Main
>cd scene
>for %%f in (*.*) do goto DoIt REM copy filename to %%f
Try..................CALL DoIt %%f
cd ..
Make DoIt a separate batch file.
>:DoIt REM Scrap this line
>cd.. REM This could be a trick...you might need PUSHDIR and
REM POPDIR, two little utilities that save and recall the
REM current directory.
>trace scene\%1
>copy scene\%1 traced
>del scene\%1
>cd.. REM Again, cd-ing in a called batch file can be trouble. You
REM may need to specify your directories or use more parameters.
>goto Main REM Scrap this line too.
You might try passing the directories used as parameters, e.g.
CALL DOIT %%f dir1 dir2 dir3 instead of using those CD commands in DOIT.
(Otherwise, those cds will have a cumulative effect that you probably don't
want; backing you up to the root)
-JTT
Technical Details
Message-ID:
<1992Nov13.180336.1678@dcatlas.dot.gov>Path:
arc1-ca.pugleaf.net!sparky!uunet!dcatlas!joetReferences:
<1dualbINN52t@usenet.INS.CWRU.Edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!dcatlas!joet From: joet@dcatlas.dot.gov (Joe Trott) Subject: Re: Batch problem Message-ID: <1992Nov13.180336.1678@dcatlas.dot.gov> Organization: U.S Dept. of Transportation References: <1dualbINN52t@usenet.INS.CWRU.Edu> Date: Fri, 13 Nov 1992 18:03:36 GMT Lines: 33