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
Copy Batch File
Moderator: DosItHelp
Re: Copy Batch File
Is this a class assignment?
what have you got so far?
what have you got so far?
Re: Copy Batch File
User_List.txt - %ComputerName% users or IP addresses
set drive=d - target disk
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
-
- Posts: 233
- Joined: 21 Nov 2010 08:07
- Location: At My Computer
Re: Copy Batch File
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>
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