Windows dosya taşıma (Windows moving file)

burayı inceleyebilirsiniz. [code language=”shell”] # Get the files which should be moved, without folders $files = Get-ChildItem ‘E:\jas\einvoice\1000\INCOME\APPRESPONSE\temp’ -Recurse | where {!$_.PsIsContainer} # List Files which will be moved $files # Target Filder where files should be moved to. The script will automatically create a folder for the year and month. $targetPath = ‘E:\jas\einvoice\1000\INCOME\APPRESPONSE\temp_toBeDeleted’ foreach ($file in $files) { # Get year and Month of the file # I used LastWriteTime since this are synced files and the creation day will be the date when it was synced $year = $file.LastWriteTime.Year.ToString() $month = $file.LastWriteTime.Month.ToString() # Out FileName, year and month $file.Name $year $month # Set Directory Path $Directory = $targetPath + "\" + $year + "\" + $month # Create directory if it doesn’t exsist if (!(Test-Path $Directory)) { New-Item $directory -type directory } # Move File to new location $file | Move-Item -Destination $Directory } [/code] Bir başka dosya taşıma yöntemi ise robocopy komutudur: [code language=”shell”] C:\Users\okinik>robocopy.exe "E:\jas\einv\1000\in\appresp\temp" "F:\temp_a" "a*.*" /S /mov /mt:128 [/code]]]>

Leave a Reply

Your email address will not be published. Required fields are marked *