locked
Get files and folders and RAR them RRS feed

  • Question

  • stop-process -processname outlook -erroraction silentlycontinue
    $today = get-date -format yyyy-MM-dd 
    [IO.Directory]::CreateDirectory("D:\System_Backup\$today")
    $backupFolder= "D:\System_Backup\$today"
    $username = $env:username

    #*******

    #Source Files

    $perFiles = "C:\users\$username\My Documents\Personal" 
    $workFiles = "C:\users\$username\My Documents\Work"
    $outlookFiles = "C:\users\$username\AppData\Local\Microsoft\outlook\"

    $per = "$backupFolder\Personal_Files_$today.rar"

    $work = "$backupFolder\Work_Files_$today.rar"

    $outlook = "$backupFolder\Outlook_Backup_$today.rar"

    C:\"Program Files\Winrar\rar.exe" a -m5 "$per" "$perFiles"
    C:\"Program Files\Winrar\rar.exe" a -m5 "$work" "$workFiles"
    C:\"Program Files\Winrar\rar.exe" a -m5 "$outlook" "$outlookFiles"

    This script is supposed to grab everything from the source directories and rar them into the designated backup folder, it only grabbed the files not the sub folders. So I tried adding a get-childitem -recurse but it errors with path not specified. How do I fix this? 


    • Edited by jeff.k11 Thursday, August 30, 2012 4:31 PM
    Thursday, August 30, 2012 4:28 PM

Answers

  • Sorry we weren't able to help you in this forum.  I hope you were able to resolve this problem by some other means.

    Best of luck,

    Kevin


    Kevin Remde US DPE - IT Evangelism - Microsoft Corporation http://blogs.technet.com/kevinremde http://twitter.com/kevinremde

    • Marked as answer by Kevin Remde Sunday, November 18, 2012 3:21 PM
    Sunday, November 18, 2012 3:21 PM