RuudJacobs.NET Posted October 15, 2004 Share Posted October 15, 2004 I'm trying to test if my SAM file (C:\Windows\System32\Config\SAM) protects my paswords good enough trough various methods. :ninja: I want to copy the sam file on to a USB-Stick, to make sure I can put it back when I **** it up :cool: . Does anyone of you know the API-call to copy a file which is in use a.t.m., or do you have an other way to do this? I found something on the internet... but that didn't work for me. Maybe because I'm not using it the right way. The API/Function/Etc I used was this: ---------------------------------------------------------------------- Private Declare Function SHFileOperation Lib "shell32.dll" _ (lpFileOp As SHFILEOP) As Long Type SHFILEOP hwnd As Long wFunc As Long pFrom As String pTo As String fFlags As Integer fAnyOperationsAborted As Long hNameMappings As Long lpszProgressTitle As String End Type Public Const FO_MOVE = &H1 Public Const FO_COPY = &H2 Public Const FO_DELETE = &H3 Public Const FOF_SILENT = &H4 Public Const FOF_ALLOWUNDO = &H40 Public Const FOF_NOCONFIRMATION = &H10 Public Const FOF_NOCONFIRMMKDIR = &H200 Public Sub FileCopyEx(lngHWnd As Long, strFromPath As String, strToPath As String) Dim ShellOp As SHFILEOP Dim lngRet As Long Dim flg As Long flg = FOF_SILENT + FOF_NOCONFIRMATION + FOF_NOCONFIRMMKDIR With ShellOp .hwnd = lngHWnd .wFunc = FO_COPY .pFrom = strFromPath .pTo = strToPath .fFlags = flg End With lngRet = SHFileOperation(ShellOp) End Sub ---------------------------------------------------------------------- However, that doesn't work :huh: . Can anyone tell me what to do? Link to comment Share on other sites More sharing options...
0 John Veteran Posted October 15, 2004 Veteran Share Posted October 15, 2004 Good luck. I doubt it's possible. The filesystem won't let anyone access the file if it's opened exclusively by another app. Link to comment Share on other sites More sharing options...
0 James Rose Posted October 15, 2004 Share Posted October 15, 2004 Take a peek at this, it looks like what you need http://groups.google.com/groups?hl=en&lr=&...sftngp11&rnum=4 Link to comment Share on other sites More sharing options...
0 RuudJacobs.NET Posted October 18, 2004 Author Share Posted October 18, 2004 dude, you rock! thanks a LOT! :D mod, you can close this topic. Link to comment Share on other sites More sharing options...
Question
RuudJacobs.NET
I'm trying to test if my SAM file (C:\Windows\System32\Config\SAM) protects my paswords good enough trough various methods. :ninja:
I want to copy the sam file on to a USB-Stick, to make sure I can put it back when I **** it up :cool: .
Does anyone of you know the API-call to copy a file which is in use a.t.m., or do you have an other way to do this?
I found something on the internet... but that didn't work for me.
Maybe because I'm not using it the right way.
The API/Function/Etc I used was this:
----------------------------------------------------------------------
Private Declare Function SHFileOperation Lib "shell32.dll" _
(lpFileOp As SHFILEOP) As Long
Type SHFILEOP
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAnyOperationsAborted As Long
hNameMappings As Long
lpszProgressTitle As String
End Type
Public Const FO_MOVE = &H1
Public Const FO_COPY = &H2
Public Const FO_DELETE = &H3
Public Const FOF_SILENT = &H4
Public Const FOF_ALLOWUNDO = &H40
Public Const FOF_NOCONFIRMATION = &H10
Public Const FOF_NOCONFIRMMKDIR = &H200
Public Sub FileCopyEx(lngHWnd As Long, strFromPath As String, strToPath As String)
Dim ShellOp As SHFILEOP
Dim lngRet As Long
Dim flg As Long
flg = FOF_SILENT + FOF_NOCONFIRMATION + FOF_NOCONFIRMMKDIR
With ShellOp
.hwnd = lngHWnd
.wFunc = FO_COPY
.pFrom = strFromPath
.pTo = strToPath
.fFlags = flg
End With
lngRet = SHFileOperation(ShellOp)
End Sub
----------------------------------------------------------------------
However, that doesn't work :huh: . Can anyone tell me what to do?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts