Jump to content

Recommended Posts

Posted

hi guys , i have  a problem with powershell and shadow copy , in practical, i want  do a snapshot  , mount it , and do a backup i have create  a script

#AutoIt3Wrapper_Compression=3
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#AutoIt3Wrapper_Add_Constants=n
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <Array.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPIFiles.au3>
#include <File.au3>
#include <Date.au3>
#include <FileConstants.au3>
#include <Process.au3>

_ShadowCopyON()



Func _ShadowCopyON()
    Local $iFileExists = FileExists(@SystemDir & "\WindowsPowerShell")

    If $iFileExists Then

        ;Runwait('powershell.exe (Get-WmiObject -list win32_shadowcopy).Create("C:\","ClientAccessible") > c:\temp\ps_create.txt', '', @SW_HIDE)
        ;Runwait(@ComSpec & 'powershell.exe (Get-WmiObject -list win32_shadowcopy).Create("C:\","ClientAccessible") > c:\temp\ps_create.txt', '')
        RunWait(@ComSpec & ' /k powershell.exe  (Get-WmiObject -list win32_shadowcopy).Create("C:\","ClientAccessible") > c:\temp\ps_create.txt | more')



    Else
        MsgBox($MB_SYSTEMMODAL, "", "Windows Powershell non esiste devi scaricarlo" & @CRLF & "FileExist returned: " & $iFileExists)
        ShellExecute("https://www.microsoft.com/it-IT/download/confirmation.aspx?id=16818") ; powershell download for windows xp
    EndIf

but  when i try to runwait always  give me this error (a powershell command )

The string starting:
At line:1 char:49
+ (Get-WmiObject -list win32_shadowcopy).Create(C: <<<< ",ClientAccessible)  
is missing the terminator: ".
At line:1 char:70
+ (Get-WmiObject -list win32_shadowcopy).Create(C:",ClientAccessible)   <<<< 
    + CategoryInfo          : ParserError: (,ClientAccessible)  :String) [], P 
   arentContainsErrorRecordException
    + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString

if  i run it at  heand work o_O

someone can help me??

thankzz at all

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
  • Recently Browsing   0 members

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