home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / msdos / programm / 10598 < prev    next >
Encoding:
Text File  |  1992-11-14  |  1.3 KB  |  44 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!dcatlas!joet
  3. From: joet@dcatlas.dot.gov (Joe Trott)
  4. Subject: Re: Batch problem
  5. Message-ID: <1992Nov13.180336.1678@dcatlas.dot.gov>
  6. Organization: U.S Dept. of Transportation
  7. References: <1dualbINN52t@usenet.INS.CWRU.Edu>
  8. Date: Fri, 13 Nov 1992 18:03:36 GMT
  9. Lines: 33
  10.  
  11. au240@cleveland.Freenet.Edu (Ari Pitkanen) writes:
  12.  
  13.  
  14.  
  15. >How do I pass '%%f' to 'DoIt'?  This approach don't work.
  16.  
  17. >---
  18. >:Main
  19. >cd scene
  20. >for %%f in (*.*) do goto DoIt   REM copy filename to %%f
  21. Try..................CALL DoIt %%f   
  22. cd ..
  23.  
  24. Make DoIt a separate batch file.
  25.  
  26. >:DoIt    REM Scrap this line
  27. >cd..     REM This could be a trick...you might need PUSHDIR and
  28.           REM POPDIR, two little utilities that save and recall the
  29.           REM current directory.
  30. >trace scene\%1               
  31. >copy scene\%1 traced          
  32. >del scene\%1
  33. >cd..     REM Again, cd-ing in a called batch file can be trouble.  You
  34.           REM may need to specify your directories or use more parameters.
  35. >goto Main     REM Scrap this line too.
  36.  
  37. You might try passing the directories used as parameters, e.g. 
  38. CALL DOIT %%f dir1 dir2 dir3      instead of using those CD commands in DOIT.
  39. (Otherwise, those cds will have a cumulative effect that you probably don't
  40. want; backing you up to the root)
  41.  
  42. -JTT
  43.  
  44.