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,633 of 42,547    |
|    Todd Vargo to foxidrive    |
|    Re: Why does this batch file not work?    |
|    17 Apr 13 17:14:35    |
      From: tlvargo@sbcglobal.netz              On 4/17/2013 10:28 AM, foxidrive wrote:       > On 17/04/2013 10:08 PM, foxidrive wrote:       >> On 17/04/2013 9:35 PM, James Burden wrote:       >>> I have a batch file that checks a folder to see if there is a file in       there. If it is then move it elsewhere.       >>       >> If this doesn't work then you may not have permissions over the files and       folders.       >       > Try this to help prove where the issue is. Adjust lines 2-4 with a copy of       the file and run it.       >       > EDITED to replace typos. Still untested.       >       > @echo off       > set "filename=[FILENAME].accdb"       > set "source=\\[SERVERNAME]\[FOLDER1]\[FOLDER2]\[FOLDER3]\WORKING ON\"       > set "target=\\[SERVERNAME]\[FOLDER1]\[FOLDER2]\"       > if exist "%source%\%FILENAME%" echo yes file "%filename%" exists in source       > if exist "%target%\%FILENAME%" del "%target%\%FILENAME%"       > if exist "%target%\%FILENAME%" echo "%filename%" was not deleted from target       > if not exist "%target%\%FILENAME%" copy /b "%source%\%FILENAME%"       "%target%\%FILENAME%"       > if not exist "%target%\%FILENAME%" echo "%filename%" was not copied from       source       > del "%source%\%FILENAME%"       > if exist "%source%\%FILENAME%" echo "%filename%" was not deleted from source              PAUSE              In case the batch is being double-clicked, add a PAUSE as the last line       so you have a chance to read any messages.              --       Todd Vargo       (Post questions to group only. Remove "z" to email personal messages)              --- 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