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,632 of 42,547    |
|    foxidrive to foxidrive    |
|    Re: Why does this batch file not work?    |
|    18 Apr 13 00:28:51    |
      From: not@this.address.invalid              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                                          --       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