Jump to content

Sundance

Active Members
  • Posts

    191
  • Joined

  • Last visited

About Sundance

  • Birthday 06/04/1969

Profile Information

  • Location
    Germany - Bonn

Recent Profile Visitors

716 profile views

Sundance's Achievements

  1. Hi Martin, I use your DLL for a little project where we are printing some labels with the help of a brother label printer. I create a QR code with createQRw.au3 and add some text to the right of it. There are two things I still have a problem. First of all I would like (also) have the ability to set the paper size to a specific value so that the user hasn't to do so. Cause when the length of the label isn't right the QR code has not a square size and won't be recognized by our scanner. The second thing is a problem I hope you have an idea. On some computers my script prints an empty second page and I don't know why. Even when the printer settings and the text to be printed and all computers are teh same. Do you have any hints for me Martin? (I'am using the _PrintImage function. It also prints a second page when printing a tiny pic which fits into the page bounderies) Is there an ability to force the printer to only print one page? many thanks in advance Martin Sundance
  2. Hi Lars, good to hear that it functions also on your side. There are some things to take into consideration when doing snapshots. It seems a good idea to clean up the code and post an example. Thanks for the info about the 64bit thingy of AddToSnapshotSet.
  3. @Lars: The AddToSnapshotSet under 64bit method definition. Does it look like this? (Can't test it at the moment) AddToSnapshotSet hresult(wstr; uint64; ptr); And would this the corresponding code? $tElem = DllStructCreate("uint64;", DllStructGetPtr($GUID_NULL)) $iResult = $oIVssBackupComponents.AddToSnapshotSet($sSource, DllStructGetData($tElem, 1), $pID)
  4. And here is i side where you can see how easy it is to get infos about the shadow copies with the help of WMI http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/computermanagement/shadow/ see you Sundance
  5. So I modified the script a little bit. Now the script will create to hardlinks on drive c called "shadowcopy_C" and "shadowcopy_D". They contain the shadowcopies. You can explore them and copy files from them. After acknowledge the messagebox the hardlinks and the shadow copies will be deleted. This is the WMI function which returns the shadow copy volume path of a given ID. Func ShowShadowcopyVolumepath($sGUID) Local $objWMIService = ObjGet('winmgmts:{impersonationLevel=impersonate}!\\' & @ComputerName & '\root\cimv2') $colItems = $objWMIService.ExecQuery("Select " & "*" & " from Win32_ShadowCopy") For $oItem In $colItems If $oItem.ID = $sGUID Then ConsoleWrite("original volume name : " & $oItem.VolumeName & @CRLF) ConsoleWrite("shadowcopy volumepath: " & $oItem.DeviceObject & @CRLF) ; volumepath of the shadowcopy Return $oItem.DeviceObject EndIf Next EndFunc COMshadow.au3
  6. With the help of the GUIDs from the drive letters we can use WMI to get the volume path. At work I can take a look for some WMI code. I can write a function which will show you the volume path of a given shadow copy GUID.
  7. Hi Lars, fine that it works also on Win7 64Bit. I'am not that far but I wanted to create shadow copies and then to give the user the possibility in showing the shadow copy within the normal windows explorer. There are also methods for showing the created set IDs and which shadow copies they contain. But this can also be achieved with WMI. Its much easier. Then when having the shadow copy volume path you enter it in the windows explorer. :-)
  8. Oh. Here is some additional code for deleting the shadow copys :-) "DeleteSnapshots hresult(uint64;uint64; int; BOOL; ptr; ptr);" ; method definition MsgBox(0,"","Press okay to delete snapshotset") Local $DelSnapShots = DllStructCreate("long") Local $pDelSnapShots = DllStructGetPtr($DelSnapShots) Local $NonDelSnapShotGUID = DllStructCreate($tagGUID) $tElem = DllStructCreate("uint64[2];", DllStructGetPtr($SetIdentifier)) $iResult = $oIVssBackupComponents.DeleteSnapshots( DllStructGetData($tElem, 1, 1), DllStructGetData($tElem, 1, 2), $VSS_OBJECT_SNAPSHOT_SET, 1, $pDelSnapShots, DllStructGetPtr($NonDelSnapShotGUID)) ConsoleWrite("deleting snapshotset " & _WinAPI_StringFromGUID(DllStructGetPtr($SetIdentifier,1)) & " returned with: " & Hex($iResult) & @CRLF) ConsoleWrite( "and " & DllStructGetData($DelSnapShots,1) & " deleted snapshots" & @CRLF ) 
  9. Hi John, yes. A shadowcopy is the base of a drive image. Even a running OS can be imaged with that. After making a shadowcopy you should open the given volumename of the snaphot with _WinAPI_CreateFile and then read the whole volume with WinAPI_ReadFile. So you can then write the read data to a file with WinAPI_WriteFile :-) Thats it :-) You also can copy single files which are in use by the operating system with the help of a shadowcopy.
  10. Hi John ;-) This COM thingy is really weird!? Thank you also for support!
  11. So master Lars. IT IS DONE! :-) After reading a nice sheet from MS which additional commands we need it now functions. The added script will take a shadow copy snapshot of drive C: and D: (under a 32Bit >=Vista operating system) I'am very thankfull of your valuable help Lars!!! Without you I hadn't no chance of doing this. Now we can do shadowcopies directly with AutoIt. Thanks! Sundance COMshadow.au3
  12. LOL Lars. Thanks for the nice words but I'am lightyears away from mastering. :-) The $sCLSID_IVssAsync GUID is wrong. I saw that its just the IID for Windows XP Async interface. So now I'am stuck. I can't call ObjCreateInterface cause I have no $sCLSID_IVssAsync value. I have no returned interface pointer to use. Its really disturbing but good to see I wasn't totally wrong...
  13. Hi Lars, how the hell got you that knowledge from? It is adding the drive to the snapshotset! How should I know to make the method with four parameters when under 32bit? Perfect!!! Now I'am with the last command DoSnapShot with the double indirect pointer. Hope that at least this I can achive.. See you later guys. Hopefully with a shadowcopy :-) happy sunday Sundance PS: 2 hours later: Puuhhh. I think I must create a Async interface cause the DoSnapShot returns a double indirect pointer to a Async interface. (C++ sample code) IVssAsync *async; result = backupComponents->DoSnapshotSet(&async); But I don't know how to create the interface without knowing the clsid. Or I'am completly on the wrong train. Can't imagine how to 'connect' the given double pointer to the interface which is an object type... This is really bad. Microsft isn't really a help here. In c++ its much easier but I don't wan't to learn c++ again :-) Hope that I get some light tomorrow... ; creating Async interface => WRONG => Global Const $sCLSID_IVssAsync = "{C7B98A22-222D-4e62-B875-1A44980634AF}" Global Const $sIID_IVssAsync = "{507C37B4-CF5B-4e95-B0AF-14EB9767467E}" Global Const $dtag_IVssAsync = _ "Cancel hresult();" & _ ; <-- Add parameters for all methods "QueryStatus hresult(ptr; ptr);" & _ "Wait hresult(int64);" $oIVssAsync = ObjCreateInterface( $sCLSID_IVssAsync, $sIID_IVSSAsync, $dtag_IVssAsync )
  14. Hi John, yes it is the same. I also played with a byte[16] structure. Cause I don't know when using DllStructGet with selected element 1 will see the whole GUID struct or only the first long value. Thanks for the tips John...!
  15. Hiho, so I'am back from work and kids are sleeping so I directly tried again. But it still throws AutoIt of the wall. I've found a webpage where they do the same thing in C++. http://wj32.org/wp/2012/12/13/how-to-backup-files-in-c-using-the-volume-shadow-copy-service-vss/ The line with the AddToSnapshotSet is like this: result = backupComponents->AddToSnapshotSet(L"D:\\", GUID_NULL, &snapshotId); I used "D:", DllStructGetData($GUID_NULL,1), $pID_D) with the method AddToSnapshotSet hresult(wstr; byte[16]; ptr);" This seems to make most sense to me but no success.... This is really tough stuff... COMshadow.au3
×
×
  • Create New...