Logiciel de maintenance Windows
Logiciel de test, Driver et Bloatwares Windows
Atlas OS est un ensemble de scripts qui modifient Windows 10 et Windows 11 pour en améliorer les performances
Crystal Disk vous permet de détecter rapidement les résultats qui pourraient être synonymes de matérielle défectueux
Site de test des enregistrements MX d'un domaine par ordre de priorité. La recherche MX est effectuée directement auprès du serveur de noms faisant autorité du domaine.
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
# Fenêtre
$form = New-Object System.Windows.Forms.Form
$form.Text = "Robocopy Tool"
$form.Size = New-Object System.Drawing.Size(820,650)
$form.StartPosition = "CenterScreen"
# Marges
$leftLabel = 20
$leftInput = 120
$top = 20
# -------- SOURCE --------
$labelSource = New-Object System.Windows.Forms.Label
$labelSource.Text = "Source :"
$labelSource.Location = "$leftLabel,$top"
$labelSource.AutoSize = $true
$form.Controls.Add($labelSource)
$textSource = New-Object System.Windows.Forms.TextBox
$textSource.Location = "$leftInput,$top"
$textSource.Size = "500,25"
$form.Controls.Add($textSource)
$btnSource = New-Object System.Windows.Forms.Button
$btnSource.Text = "Parcourir..."
$btnSource.Location = "640,$top"
$btnSource.Size = "120,25"
$form.Controls.Add($btnSource)
# -------- DEST --------
$top += 50
$labelDest = New-Object System.Windows.Forms.Label
$labelDest.Text = "Destination :"
$labelDest.Location = "$leftLabel,$top"
$labelDest.AutoSize = $true
$form.Controls.Add($labelDest)
$textDest = New-Object System.Windows.Forms.TextBox
$textDest.Location = "$leftInput,$top"
$textDest.Size = "500,25"
$form.Controls.Add($textDest)
$btnDest = New-Object System.Windows.Forms.Button
$btnDest.Text = "Parcourir..."
$btnDest.Location = "640,$top"
$btnDest.Size = "120,25"
$form.Controls.Add($btnDest)
# -------- SÉPARATEUR --------
$top += 50
$separator = New-Object System.Windows.Forms.Label
$separator.BorderStyle = "Fixed3D"
$separator.Location = "20,$top"
$separator.Size = "740,2"
$form.Controls.Add($separator)
# -------- BOUTON --------
$top += 20
$btnRun = New-Object System.Windows.Forms.Button
$btnRun.Text = "Lancer la copie"
$btnRun.Location = "20,$top"
$btnRun.Size = "740,40"
$btnRun.BackColor = "#2D74DA"
$btnRun.ForeColor = "White"
$btnRun.FlatStyle = "Flat"
$form.Controls.Add($btnRun)
# -------- OUTPUT --------
$top += 60
$outputBox = New-Object System.Windows.Forms.RichTextBox
$outputBox.Location = "20,$top"
$outputBox.Size = "740,450"
$outputBox.ReadOnly = $true
$outputBox.BackColor = "#1E1E1E"
$outputBox.ForeColor = "White"
$outputBox.Font = "Consolas,10"
$form.Controls.Add($outputBox)
# -------- DIALOG --------
$folderBrowser = New-Object System.Windows.Forms.FolderBrowserDialog
$btnSource.Add_Click({
if ($folderBrowser.ShowDialog() -eq "OK") {
$textSource.Text = $folderBrowser.SelectedPath
}
})
$btnDest.Add_Click({
if ($folderBrowser.ShowDialog() -eq "OK") {
$textDest.Text = $folderBrowser.SelectedPath
}
})
# -------- ROBOCOPY --------
$btnRun.Add_Click({
$source = $textSource.Text
$dest = $textDest.Text
if (!(Test-Path $source) -or !(Test-Path $dest)) {
[System.Windows.Forms.MessageBox]::Show("Chemins invalides")
return
}
$logFile = Join-Path $dest ("robocopy_" + (Get-Date -Format "yyyyMMdd_HHmmss") + ".log")
$args = @(
"`"$source`"",
"`"$dest`"",
"/E",
"/XO",
"/R:1",
"/W:1",
"/TEE",
"/LOG:`"$logFile`""
)
$outputBox.Clear()
$process = New-Object System.Diagnostics.Process
$process.StartInfo.FileName = "robocopy.exe"
$process.StartInfo.Arguments = $args -join " "
$process.StartInfo.RedirectStandardOutput = $true
$process.StartInfo.UseShellExecute = $false
$process.StartInfo.CreateNoWindow = $true
$process.Start() | Out-Null
while (-not $process.HasExited) {
$line = $process.StandardOutput.ReadLine()
if ($line) {
$outputBox.AppendText($line + "`n")
$outputBox.ScrollToCaret()
$form.Refresh()
}
}
while (!$process.StandardOutput.EndOfStream) {
$line = $process.StandardOutput.ReadLine()
$outputBox.AppendText($line + "`n")
}
[System.Windows.Forms.MessageBox]::Show("Copie terminée !")
})
$form.ShowDialog()