Page 1 of 1

Copy Batch File

Posted: 05 Jul 2012 03:03
by Basic_Programming
Hi Guys

I am doing a batch file to copy a PDF from the C:\ Drive - the D:\users desktop folder. i have used the xcopy command to do this and also the %HOMEPATH% command aswell so it goes to the users desktop folder to then display it on the desktop, but this isnt working any help.

sorry for not much detail as i dont do alot of DOS

:?:

Re: Copy Batch File

Posted: 05 Jul 2012 04:00
by foxidrive
Is this a class assignment? :)

what have you got so far?

Re: Copy Batch File

Posted: 05 Jul 2012 10:03
by e4nd
User_List.txt - %ComputerName% users or IP addresses
set drive=d - target disk

Code: Select all

@echo off

set drive=d

for /f "delims=" %%! in (User_List.txt) do (
   copy "c:\Drive\*.pdf"  "\\%%!\%drive%$\%HOMEPATH%\desktop\*.pdf"
)
pause>nul

Re: Copy Batch File

Posted: 06 Jul 2012 19:10
by Dos_Probie
I am doing a batch file to copy a PDF from the C:\ Drive - the D:\users desktop folder


You could use the For command to copy a user list from a text file
or you could just keep it simple and use a user variable for different default users.<see code below> 8)

Code: Select all

@echo off
::use wildcard to copy over all .pdf file/s from C <source> to the system or d drive <destination>::
xcopy c:\*.pdf  %userprofile%\desktop\Pdf\ /s/e/h/f/c/q/i