copy - Append Command From One Batch to another -


i trying write batch file write new line "move" command second batch file. have master batch file move command every pc uses piece of our software can records network drive (scheduled run daily). data on local pc's gets deleted after 20 days , need create place hold these files permanently. unfortunately best way keep our data backed up, i'm trying automate process make process easy can department. i'm trying command below think it's issue quotation marks. appreciated, thanks!

    :start       echo.     set /p pcid=please enter pcid setup auto-archiving:         if "%pcid%"=="%%" (goto confirmpc)         if "%pcid%"=="exit" (goto end)      :confirmpc      echo.     echo please verify "%pcid%" correct...     echo.     set /p verify=enter y/n...         if "%verify%"=="y" (goto setupautoarc)         if "%verify%"=="n" (goto start)         if "%verify%"=="%%" (goto verifyerror)         if "%verify%"=="exit" (goto end)      :verifyerror      echo.     echo please enter valid (y/n) response...     (goto confirmpc)      :setupautoarc      echo.     echo creating directory...     mkdir "\\server32\e$\backup data\%pcid%"     echo. (here i'm running trouble)     echo "move "\\%pcid%\c$\program files\application\data\*.xml" > "\\server32\c$\scripts\masterbackup.bat     echo.     set /p endresp=finished! run pcid? (y/n)         if "%endresp%"=="y" (goto start)         if "%endresp%"=="n" (goto end)      :end      exit 

echo "move "\\%pcid%\c$\program files\application\data\*.xml" > "\\server32\c$\scripts\masterbackup.bat ---- ^ remove quote , add waaaaay @ end...................................^.here 

the syntax echo string > file

where quotes should balanced , need placed around (full-)filename contains spaces (etc.)

note > write data new file, deleting exiting (if any). use >> append existing file.


having said that, command put or add line

move "\\%pcid%\c$\program files\application\data\*.xml" 

to file "\\server32\c$\scripts\masterbackup.bat"

that doesn't seem particularly rational. shouldn't moveing fileset somewhere , appending that move command batch?


Comments