Wie können wir helfen?

Edge Favorite Backup Script

Du bist hier:
< Alle Themen

<#

  Creates a Scheduled Task and copies all needed files to the client

.DESCRIPTION

  This script creates a scheduled task and copies the needed files to the client

#>

# Define some variables

$Scriptname = „BackupEdgeBookmarks“

$ScriptVersion = „1.1“

$Destination = $env:ProgramFiles + „\Backup\“ + $Scriptname

# Source files that need to be copied to the client need to be in this directory!

$Source = „.\“ + $Scriptname

# to ensure a clean (re-)install, we remove all files and folders from previous installations

if (Test-Path $Destination)

{

    remove-item -path $Destination -Recurse

}

copy-item -path $Source -Destination $Destination -Recurse

# Query if scheduled task from previous installation exists. If yes, delete it!

if (schtasks /Query /tn „Backup Edge Bookmarks“)

{

    schtasks /Delete /tn „Backup Edge Bookmarks“ /F

}

#Create scheduled task that runs the backup of the bookmarks each time a user logs in

schtasks.exe /Create /XML „BackupEdgeBookmarks.xml“ /tn „Backup Edge Bookmarks“

# Check if Script Version in Registry is up to date

$registryPath = „HKLM:\SOFTWARE\Backup\BackupEdgeBookmarks“

$Name = „Version“

$value = $ScriptVersion

if (!(Test-Path $registryPath))

{

    New-Item -Path $registryPath -Force | Out-Null

    New-ItemProperty -Path $registryPath -Name $name -Value $value | Out-Null

}

else

{

    Set-ItemProperty -Path $registryPath -Name $name -Value $value

}

Inhaltsverzeichnis