Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch    |    Fun with MS-DOS batch files    |    42,547 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 40,575 of 42,547    |
|    foxidrive to Todd Vargo    |
|    Re: Dynamic Setting of variable based on    |
|    19 Nov 12 21:27:32    |
   
   From: not@this.address.invalid   
      
   On 14/11/2012 23:21, Todd Vargo wrote:   
   > On 11/15/2012 6:53 AM, Nathan Wilson wrote:   
      
   >> I have a directory structure   
      
   This is on a local copy, not on the remote sever right?   
      
   >> X:\A\B\w.txt   
   >> X:\A\C\x.txt   
   >> X:\A\D\y.txt   
   >> X:\A\E\z.txt   
   >>   
      
   >> I need the code to go to first folder, set folderName to name of   
   >> folder and then get file inside   
   >>   
   >> Once I have folder and file name I can pass to sub routine that   
   >> processes   
   >>   
   >> Once that is ran the process should then go to the next folder and run   
   >> again replacing the folder name with the next in line   
   >>   
   >> So basically go to A   
   >> Set folderName = B   
   >> Set filename = w.txt   
   >>   
   >> process in sub routine   
   >>   
   >> go to A   
   >> Set folderName = C   
   >> Set filename = x.txt   
   >>   
   >> process etc etc   
      
   Run this in A and see what it spits out.   
      
   @echo off   
   for /f "delims=" %%a in ('dir /ad /b /s') do (   
   pushd "%%a"   
   for %%b in (*.txt) do echo folder is: "%%~nxa" file is: "%%b"   
   pause   
   popd   
   )   
      
      
      
      
   --   
   foxi   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca