. Bat script to copy files

  goose1984 13:02 25 Nov 2005
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 2005

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 2005

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 2005

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 2005

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 2005

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 2005

Try looking here

click here

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

Elsewhere on IDG sites

Xiaomi Mi Mix 2 review

What went wrong at the Designs of the Year 2017

iPhone X news: Release date, price, new features & specs

Comment regarder des séries et talk-shows américains en France ?