Jump to content

Search the Community

Showing results for tags 'subdirectories'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hi All, I'm making a stage 1 preparation script to apply to target worksation Win 7 and Win 8.1 machines -in preparation to running a separate batch script later (stage 2) within our Windows Server with "netdom.exe move" xxxxxxxx Stage 1 Script Tasks: 1. delete some common shortcuts 2. Then move all files within common user profile backup locations - including any files in the sub-directories of the common backups locations within each users profile folder. Stage 1 Script Purpose: Make it easy for staff to grab files and folders from one C:\_Backup directory Stage 1 Script PROBLEM: The script successfully removes the desired shortcuts - that part works well. Problem is it only copies files in root directory of each users common folder (eg: Desktop) but doesn't move all the sub-directories and its files and move it to the corresponding backup directory. I've searched the whole AutoIT forum domain for ideas but I've hit a dead end. Here is the code: ;START TASKS-------------------------------------------------------------------------- #include <FileConstants.au3> $ccsystem32 = @SystemDir ;define C:\Windows\System32 folder $ccdesktop = @DesktopCommonDir ;define all users desktop location ;rename CompanyName Remote Desktop shortcut FileCopy($ccdesktop&"\Remote Desktop.rdp", $ccdesktop&"\Company Remote Desktop.rdp", 0) ;delete copies of "SHIP", "eKeySilent", "eKey Manual Login", "eKey Admin" and "ConnX Login" from every profile, adds a copy ot each Desktop folder. $folder = StringLeft(@UserProfileDir,StringInStr(@UserProfileDir,"\",0,-1)) $search = FileFindFirstFile($folder&"*") While 1 $profile = FileFindNextFile($search) If @error Then ExitLoop If FileExists($folder&$profile&"\desktop\SHIP.url") Then FileDelete($folder&$profile&"\desktop\SHIP.url") EndIf If FileExists($folder&$profile&"\desktop\ekeySilent.lnk") Then FileDelete($folder&$profile&"\desktop\ekeySilent.lnk") EndIf If FileExists($folder&$profile&"\desktop\eKey Manual Login.url") Then FileDelete($folder&$profile&"\desktop\eKey Manual Login.url") EndIf If FileExists($folder&$profile&"\desktop\ConnX Login.lnk") Then FileDelete($folder&$profile&"\desktop\ConnX Login.lnk") EndIf If FileExists($folder&$profile&"\desktop\eKey Admin.url") Then FileDelete($folder&$profile&"\desktop\eKey Admin.url") EndIf If FileExists($folder&$profile&"\desktop\Remote Desktop.rdp") Then FileDelete($folder&$profile&"\desktop\Remote Desktop.rdp") EndIf ;backup desktop folder of each user If FileExists($folder&$profile&"\desktop\"&"*.*") Then FileMove($folder&$profile&"\desktop\"&"*.*", "C:\_Backup\"&$profile&"\Desktop\", 9) ;flag combining overwrite existing files & create destination structure EndIf ;backup downloads folder of each user If FileExists($folder&$profile&"\downloads\"&"*.*") Then FileMove($folder&$profile&"\downloads\"&"*.*", "C:\_Backup\"&$profile&"\Downloads\", 9) ;flag combining overwrite existing files & create destination structure EndIf ;backup Documents folder of each user If FileExists($folder&$profile&"\documents\"&"*.*") Then FileMove($folder&$profile&"\documents\"&"*.*", "C:\_Backup\"&$profile&"\Documents\", 9) ;flag combining overwrite existing files & create destination structure EndIf ;backup pictures folder of each user If FileExists($folder&$profile&"\pictures\"&"*.*") Then FileMove($folder&$profile&"\pictures\"&"*.*", "C:\_Backup\"&$profile&"\Pictures\", 9) ;flag combining overwrite existing files & create destination structure EndIf ;backup music folder of each user If FileExists($folder&$profile&"\music\"&"*.*") Then FileMove($folder&$profile&"\music\"&"*.*", "C:\_Backup\"&$profile&"\Music\", 9) ;flag combining overwrite existing files & create destination structure EndIf ;backup videos folder of each user If FileExists($folder&$profile&"\videos\"&"*.*") Then FileMove($folder&$profile&"\videos\"&"*.*", "C:\_Backup\"&$profile&"\Videos\", 9) ;flag combining overwrite existing files & create destination structure EndIf ;backup IEfavorites folder of each user If FileExists($folder&$profile&"\favorites\"&"*.*") Then FileMove($folder&$profile&"\favorites\"&"*.*", "C:\_Backup\"&$profile&"\IEFavorites\", 9) ;flag combining overwrite existing files & create destination structure EndIf WEnd FileClose($search) ;end of deletion of old shortcuts and copying of user files in backup directories.I tried DirMove but I can confirm that windows wont let me move the whole eg: Desktop folder as its read only and I obviously dont want to screw up that account as well (in case we need to log into it) - so I don't want to for example delete the actual Desktop directory. Just move I dont know how to move only all the sub-directories of all the above folders eg: Desktop - and not move the directory eg: Desktop itself. is it 2 problems? sub-directories are read only?DirMove is not allowed to copy any sub-directories? Reason why I was asked to use FileMove and DirMove is that we are concerned of running out of C drive space if we use FileCopy and DirCopy (works on eg: Desktop dir) How file structure of C:\_Backup should look like on each target workstation system: but it should not move the for eg: C:\Users\Admin\Desktop but should move all of its files and folders. Why move not copy? C drive space is limited on each workstation, so I don't want to create double the files. Example of Desired File structure of backup directory: C:\_Backup\ C:\_Backup\Admin\ .\Desktop\* (includes all files & subdirectories) .\Documents\* (includes all files & subdirectories) .\Downloads\* (includes all files & subdirectories) .\IEFavorites\* (includes all files & subdirectories) .\Music\* (includes all files & subdirectories) .\Pictures\* (includes all files & subdirectories) .\Vidoes\* (includes all files & subdirectories) C:\_Backup\Administrator\ .\Desktop\* (includes all files & subdirectories) .\Documents\* (includes all files & subdirectories) .\Downloads\* (includes all files & subdirectories) .\IEFavorites\* (includes all files & subdirectories) .\Music\* (includes all files & subdirectories) .\Pictures\* (includes all files & subdirectories) .\Vidoes\* (includes all files & subdirectories) C:\_Backup\Administrator.DomainName\ .\Desktop\* (includes all files & subdirectories) .\Documents\* (includes all files & subdirectories) .\Downloads\* (includes all files & subdirectories) .\IEFavorites\* (includes all files & subdirectories) .\Music\* (includes all files & subdirectories) .\Pictures\* (includes all files & subdirectories) .\Vidoes\* (includes all files & subdirectories) C:\_Backup\Default\ .\Desktop\* (includes all files & subdirectories) .\Documents\* (includes all files & subdirectories) .\Downloads\* (includes all files & subdirectories) .\IEFavorites\* (includes all files & subdirectories) .\Music\* (includes all files & subdirectories) .\Pictures\* (includes all files & subdirectories) .\Vidoes\* (includes all files & subdirectories) C:\_Backup\Default User\ .\Desktop\* (includes all files & subdirectories) .\Documents\* (includes all files & subdirectories) .\Downloads\* (includes all files & subdirectories) .\IEFavorites\* (includes all files & subdirectories) .\Music\* (includes all files & subdirectories) .\Pictures\* (includes all files & subdirectories) .\Vidoes\* (includes all files & subdirectories) C:\_Backup\User1 .\Desktop\* (includes all files & subdirectories) .\Documents\* (includes all files & subdirectories) .\Downloads\* (includes all files & subdirectories) .\IEFavorites\* (includes all files & subdirectories) .\Music\* (includes all files & subdirectories) .\Pictures\* (includes all files & subdirectories) .\Vidoes\* (includes all files & subdirectories) C:\_Backup\Public\ .\Desktop\* (includes all files & subdirectories) .\Documents\* (includes all files & subdirectories) .\Downloads\* (includes all files & subdirectories) .\IEFavorites\* (includes all files & subdirectories) .\Music\* (includes all files & subdirectories) .\Pictures\* (includes all files & subdirectories) .\Vidoes\* (includes all files & subdirectories) Anybody has any ideas or assistance? Might be a really simple thing that I missed. Something missing to the while loop? Maybe the whole while loop needs to be redesigned? ???
×
×
  • Create New...