home bbs files messages ]

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,677 of 42,547   
   foxidrive to John Harris   
   Re: Any suggestion - Create directory ba   
   14 Jun 13 01:32:17   
   
   From: not@this.address.invalid   
      
   On 14/06/2013 01:02, John Harris wrote:   
   > This may explain it better.   
   >   
   > What I would like to do is take a file called (eg) EW120613001.pdf and save   
   it into \\server\share\FOLDER\1st 6 digit ddmmyy from filename \EW120613001.pdf   
   >   
   > 1. Characters 1,2 ignore   
   > 2. Digits 3-8 (6 digit ddmmyy) from filename   
   > 3. Creates directory based on the 6 digits, if not there   
   > 4. If the directory is already there create Nul Errors.   
   > 5. Move the file into the directory.   
      
   Try this - untested:   
      
   @echo off   
   set "file=EW120613001.pdf"   
   set "datestamp=%file:~2,6%"   
   md "\\server\share\FOLDER\%datestamp%" 2>nul   
   move "%file%" "\\server\share\FOLDER\%datestamp%"   
      
      
   --   
   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