. Bat script to copy files

  goose1984 13:02 25 Nov 05
Locked

Hi all,

Does anyone know any good resources where I can learn how to write a script where if I run it, it will copy C:blah/files/ to H:

Cheers

  Thalmus 13:33 25 Nov 05

xcopy c:\blah\files\*.* H:

this will copy all the files from the folder to h:

more info on xcopy can be found if you click here

  MAJ 13:36 25 Nov 05

Assuming XP:

xcopy "C:\Documents and Settings\username\Desktop\new.txt" H:

typed into Start > Run and click OK will copy "new.txt" from the desktop to the H drive.

  pj123 13:42 25 Nov 05

Don't forget batch files run in DOS which only recognises the 8.3 format. So typing copy (or xcopy) C:\my documents\*.* h: won't work.

It's probably easier to just use Windows Explorer or (in my case PowerDesk) and Copy and Paste or Drag and Drop.

  goose1984 14:48 25 Nov 05

Ok thanks.
I havent managed to hack together this:

@Echo off
CLS

Echo. Are you sure?
Choice /C:YN /N/S
if errorlevel = 1 then goto ok
if errorlevel = 0 then goto end

:Copy
xcopy c:\test\*.* /e /k /i /c N:\Jamie


:End

BUT If I wanted to add a question in the script such as Are you sure you wnt to copy Y/N how would I do that?

  goose1984 14:49 25 Nov 05

sorry that was when i was mucking around with CHOICE but choice is not in XP only in 98

so i actually have

@Echo off
CLS

Echo. Are you sure?
Pause
if errorlevel = 1 then goto ok
if errorlevel = 0 then goto end

:Copy
xcopy c:\test\*.* /e /k /i /c N:\Jamie


:End

  Thalmus 23:12 25 Nov 05

Try looking here

click here

This thread is now locked and can not be replied to.

Nintendo Switch review: Hands-on with the intuitive modular console and its disappointing games…

1995-2015: How technology has changed the world in 20 years

This abstract video touches on division in our technologic world

Best alternatives to iTunes for Mac | Best music players for macOS: Free your music from the…