robocopy

Robocopy and get Copied file name

岁酱吖の 提交于 2020-01-17 07:11:53
问题 I'm using robocopy to only sync only newer file, but I also need to get the file name being copied. I've to further use copied file name to make a entry in a some other file. I wasn't able to found switch, which only displays copied file name, any powershell script of batch file will also be fine. 回答1: This function parses all the RoboCopy text output and outputs that as a nice object. Use it like this: $RoboCopyOutput = robocopy $source $destination /ROBOSWITCHES Parse-RoboCopyOutput

How can i only copy folders with robocopy in powershell?

房东的猫 提交于 2020-01-16 05:10:06
问题 How can i copy only the folders in a directory with powershell and robocopy? Get-ChildItem 'C:\temp\test' | ForEach-Object { $newname = ($_.BaseName -Replace '[^\x20-\x5D,\x60-\x7E]+', '-') write-host $_.BaseName write-host $newname robocopy.exe 'C:\temp\test\'$_.BaseName 'C:\temp\test\copy\'$newname } Edit Thanks works great Get-ChildItem 'C:\temp\test' | ForEach-Object { $newname = ($_.BaseName -Replace '[^\x20-\x5D,\x60-\x7E]+', '-') if (($_.GetType()).Name -eq "DirectoryInfo"){ write-host

Converting Robocopy Batch To VB Script

送分小仙女□ 提交于 2020-01-14 19:53:10
问题 I'm trying to convert a BATCH file I am still working on (question at Robocopy | Mirror Destination Including Source Parent Folder). I've made some progress, and the reason I moved to VB is to add a bit more functionality, like adding a dialog box to ask the user to browse for a folder they'd like to backup... Now the code I currently have (only partially converted from my original .bat file); Dim Command1 Set objShell = CreateObject("Shell.Application") Set objFolder = objShell

How can i change the colour of a command window via batch script when using the start command

孤人 提交于 2020-01-05 12:34:22
问题 i am running a number of small batch scripts to copy data from one location to another using robocopy i have pasted a sample below. what i need to do for each of these batch files is get it to open and run the robocopy commands listed (which it is doing) but i need the robocopy output windows to be in set colours per batch file. the batch file reads as below start robocopy.exe "source" "destination" /MIR /Log:e:\outputlog.txt /TEE start robocopy.exe "source" "destination" /MIR /Log:e:

Robocopy commands to copy a file to over 50 remote machines

泪湿孤枕 提交于 2020-01-05 08:13:33
问题 I started looking at robocopy yesterday to try to copy and overwrite a file from one destination to many remote computers. I've tried Robocopy to copy files to a remote machine but it doesn't work. I get the same error as the person in the link. Does anybody have any suggestions or lead me in the right way ? thank you so much ! 回答1: You could just use PowerShell for this. It has an inefficiency issue wherein it would copy one at a time but that shouldnt be an issue for 50ish machines. This

robocopy MAXAGE / MINAGE value with hours and minutes

落花浮王杯 提交于 2020-01-03 08:44:09
问题 I am trying to copy files from server to another server every hour as files being created. I was using Robocopy for copying file, and its very useful. But now I am really stuck with this. I need to copy files with MINAGE value of minutes, something like that. if i ran robocopy after 2pm, i should able to copy only file which created before 2PM Robocopy MAXAGE and MINAGE only accepts date not time. Any suggestion 回答1: Why u don't use the MIR function and run the job every 60 min via task

robocopy(一)

女生的网名这么多〃 提交于 2019-12-30 19:14:17
robocopy /e 复制所有文件(包含空目录) 例:将D盘CopyTest中的所有文件复制到E盘CopyTest文件夹 robocopy d : \CopyTest e : CopyTest / e /s 复制所有文件(不包含空目录) 例:将D盘CopyTest中的所有文件复制到E盘CopyTest文件夹 robocopy d : \CopyTest e : CopyTest / s dcopy:t 复制原文件时间戳到目标文件 例: /b 备份模式,注:在复制文件中有带域名的用户权限时,必须加此参数,不然带域名的用户权限不会进行复制。 /b 可重启的备份模式,比较/b复制效率会有所下降 来源: CSDN 作者: TinyXin 链接: https://blog.csdn.net/TinyXin/article/details/103769790

invalid parameter in robocopy syntax

我只是一个虾纸丫 提交于 2019-12-25 03:19:12
问题 When I try to copy folder from my server to another computer using robocopy and use the parameter /a:-sh in order to enforce the destination folder not to be hidden (because I copy administrative shared folder) my script is: Robocopy.exe "\myserver\e$" "c:\destinationfolder" /e /r:2 /w:3 /np /A:-SH and in my log I see the error Invalid parameter #7: "/A:-SH" What is the problem? 回答1: /A-:SH Documentation states that the arguments are /A+:[RASHCNET] or /A-:[RASHCNET] 来源: https://stackoverflow

Batch to archive files

断了今生、忘了曾经 提交于 2019-12-24 11:27:27
问题 I am making a script that can allow me to archive all files of a given directory whom last modified date is superior to 30 days. The files should be moved to a new folder and this folder must be zipped afterwards. Aditionaly - and this is a bit crutial - in the archiving process, the files should be grouped by month. The name of the zipped folder should indicate the month and year of the contained files. Example: 2012_12.zip (contains all files from December 2012) ; 2013_01.zip (contains all

Moving jpg's using powershell script with variable directories

两盒软妹~` 提交于 2019-12-24 10:55:47
问题 I am writing a scheduled script that will move images (jpg's) from one location to another. The problem is that a parent directory is variable in name while the end directory is fixed. If robocopy would do this I would be happy: robocopy C:\temp\pcbmodel**\defect c:\test**\defect*. But it doesn't For example this will almost work: foreach ($i in Get-ChildItem C:\temp\pcbmodel\*\*\defect -recurse) { if ($i.CreationTime -lt ($(Get-Date).AddMonths(0))) { write $i.FullName Copy-Item $i.FullName C