home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,359 of 68,980   
   JJ to dr.j.r.stockton@gmail.com   
   Re: To stop XCOPY asking F or D in batch   
   25 Jan 19 05:49:40   
   
   From: jj4public@vfemail.net   
      
   On Thu, 24 Jan 2019 12:25:58 -0800 (PST), dr.j.r.stockton@gmail.com wrote:   
   > I run a batch program (Windows 10 usually; could be earlier maybe)   
   > which uses XCOPY (I cannot use COPY, as XCOPY's /D is needed).   
   >   
   > I use   
   >   FOR /F "eol=; tokens=1*" %%J IN ... (   
   >     ...   
   >     XCOPY /D /Y %%J  %unto%%%J %%K | FIND /v " File(s) copied"   
   >     )   
   >   
   > After various enhancements, it now sometimes asks whether the   
   > name on the destination should be a file or a directory, but   
   > without the (F = file, D = directory)? - I expect the FIND /v   
   > eats that.   
   >   
   > Is there a good way to eliminate that question, and choose   
   > file every time?  Nothing shown by FIND /? seems suitable,   
   > but ICBW.  I can answer it "blind", but that's not nice.   
   >   
   > This is an example of what I mean, I think :-   
   >     Prompt>xcopy pascal.htm e:fred.kk   
   >     Does E:fred.kk specify a file name   
   >     or directory name on the target   
   >     (F = file, D = directory)?   
      
   XCOPY will prompt you that if the destination doesn't exist. To always treat   
   the destination as a file, make sure the destination exists as a file. So,   
   create an empty file using the destination path, before executing XCOPY.   
   e.g.   
      
     set src=pascal.htm   
     set dest=e:fred.kk   
     (rem.>%dest%)2>nul   
     xcopy /y %src% %dest%   
      
   --- 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