Jump to content

copy open files


Recommended Posts

Does anyone know of a way to copy an open file.

I have found a way which work great http://blogs.msdn.com/b/adioltean/archive/2005/01/05/346793.aspx

I have also failed abysmally in trying to convert it to an autoit script

here is my failed attempt

; Script Start - Add your code below here
#include <Process.au3>

local $CALLBACK_SCRIPT

If NOT ($CALLBACK_SCRIPT=="") Then IS_CALLBACK()

IF $CmdLine[0] = 0 Then Msgbox (0,"Source and dest","must enter source and dest")


$s = $CmdLine[1]

$SOURCE_DRIVE_LETTER=StringLeft($s,2)
$SOURCE_RELATIVE_PATH=StringtrimLeft($s,3)
$DESTINATION_PATH=$CmdLine[2]

$CALLBACK_SCRIPT=@ScriptFullPath
$TEMP_GENERATED_SCRIPT="GeneratedVarsTempScript.cmd"

_Rundos("\vshadow.exe -script=" & $TEMP_GENERATED_SCRIPT & "-exec=" & $CALLBACK_SCRIPT &" "& $SOURCE_DRIVE_LETTER) 

FileDelete ($TEMP_GENERATED_SCRIPT)


Func IS_CALLBACK()

Run($TEMP_GENERATED_SCRIPT)
filecopy ($SHADOW_DEVICE_1 & "\" & $SOURCE_RELATIVE_PATH,$DESTINATION_PATH)

EndFunc
Edited by vickerps
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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